Commit Graph

161 Commits

Author SHA1 Message Date
Hixie
fd842810c9 Port ensure_visible.dart to fn3.
This concludes the fn3 port!
2015-10-26 12:44:54 -07:00
Hixie
b1dbf4528c Radio<T> and ValueChanged<T>
Make Radio widgets take a type that describes the type of their value,
so that you can catch when you use the wrong value.

Standardise on ValueChanged<Foo> instead of having a FooValueChanged
for every value of Foo.
2015-10-26 11:03:24 -07:00
Hixie
a6c473ea95 Strong modeify the examples
This makes skyanalyzer also check the examples, and fixes everything it
found there.
2015-10-23 18:13:25 -07:00
Jim Beveridge
9ea722d9b6 Merge pull request #1717 from jimbeveridge/piano
Fix slow sound init in piano sample app
2015-10-22 15:23:32 -07:00
Hans Muller
d25039df30 Use a type parameter for Dropdown value 2015-10-22 15:14:32 -07:00
Jim Beveridge
4b60def23c Fix slow sound init in piano sample app
Fixes #1696. Also fixes handles leaking on error.
2015-10-22 14:58:31 -07:00
Hixie
bd9036cdb8 Port spinning_mixed demo to fn3 2015-10-22 14:20:13 -07:00
Hans Muller
33c7820d7e Adds initial versions of DropdownButton DropdownMenuItem
Adds a dropdown menu button as shown in the Material design spec here: https://www.google.com/design/spec/components/buttons.html#buttons-dropdown-buttons. It's the video at the bottom of this section of the Material design spec.

This version of the component doesn't deal with scrollable menus or
constrain the height of the menu.
2015-10-22 13:38:50 -07:00
Adam Barth
de395582d5 Add Navigator.of
Now you don't need to pass the navigator around everywhere.
2015-10-22 12:32:42 -07:00
Adam Barth
d54d35d3d1 Adds EnterExitTransition widget
This widget smoothly resizes as its child changes and lets you provide entrance
and exit transitions for its children.
2015-10-20 15:37:55 -07:00
Adam Barth
f79fdff2d0 Move animation curves into a Curves namespace 2015-10-19 18:08:52 -07:00
Adam Barth
529fa95f87 Give the CustomPaint and SizeObserver callbacks better names
The style we use for callbacks in widgets is "onFoo". These classes were using
an order naming convention and just called their callbacks "callback".
2015-10-19 17:27:40 -07:00
Adam Barth
715b304ea2 Convert Align to use FractionalOffset instead of two doubles
It was confusing as to whether these were fractions or pixels.

Fixes #1622
2015-10-19 12:56:38 -07:00
Adam Barth
47c854b8fc Merge pull request #1673 from abarth/rm_old_paint_setters
Remove old setFoo functions on Paint
2015-10-19 12:28:09 -07:00
Adam Barth
2aa79d5694 Remove old setFoo functions on Paint
We now just use Dart properties, which is more idiomatic.
2015-10-19 12:21:34 -07:00
Adam Barth
27b5fc14a3 Scaffold should wrap its body in a Material
Fixes #1669
2015-10-19 12:11:10 -07:00
Hans Muller
cd27fd2370 Merge pull request #1647 from HansMuller/restore_overlay_geometry
Restored overlay_geometry example
2015-10-16 11:13:16 -07:00
Hans Muller
ccfecf434d Restored overlay_geometry example 2015-10-16 11:00:12 -07:00
Hans Muller
2609f7bf8e OMG I've been running with checking turned off. Fixed scrollbar assertion failures. 2015-10-16 10:14:26 -07:00
Hixie
7946dc3a34 Write down some unwritten rules of Flutter development. 2015-10-14 09:58:29 -07:00
Hans Muller
921d432092 Added Painter, ScrollingListPainter, MaterialScrollbarPainter
Enabled displaying a scrollbar in ScrollingLists. The scrollbar is painted as an "overlay", i.e. it's painted on top of the scrolling list's visible children.

Added an abstract Painter base class that encapsulates a paint method and the renderer that it's attached to. RenderBlockViewport and HomogenousViewport now support an overlayPainter property. If specified, RenderBlockViewport attaches itself to the overlayPainter when it's attached to the rendering tree. RenderBlockViewport now calls overlayPainter.paint() after it has painted its children.

Added an abstract ScrollingListPainter class that exposes ScrollingList's state which might be needed for painting. Like its scroll direction and scrollOffset. The ScrollingListPainter is notified when a scroll starts and ends.

Defined a Material-specific ScrollingListPainter that renders a scrollbar. The scrollbar thumb is faded in/out when the scroll starts/ends.

Added onScrollStart and onScrollEnd listeners to Scrollable.
2015-10-14 07:59:41 -07:00
Adam Barth
89faf21a10 Merge pull request #1596 from abarth/moar_nine
Add a centerSlice parameter to images
2015-10-13 14:24:06 -07:00
Hixie
1cf1cf9c64 Port first sector demo to fn3
Also, fix warnings in rendering/sector_layout.dart
Also, fix hit testing in rendering/sector_layout.dart
Also, add WidgetToRenderBoxAdapter
Also, make the rendering library debugging tools more resilient to
dumping stuff before layout is complete.
2015-10-13 14:21:52 -07:00
Adam Barth
998a066a82 Add a centerSlice parameter to images
This lets you draw nine-patch images.
2015-10-13 13:21:36 -07:00
Adam Barth
5a7d21675a Remove demo_launcher
This example is outdated.
2015-10-12 14:20:28 -07:00
Adam Barth
bb9cf6d78b Add .old extension to silence analyzer
These examples haven't been ported to fn3 yet. Before this patch, they caused a
lot of noise in the analyzer output.
2015-10-12 13:45:33 -07:00
Adam Barth
09665c0d7f Change the default MaterialType to canvas
Canvas is by far the most popular type of material by call site (and makes for
a faster default because it doesn't have a RRect clip).
2015-10-12 09:36:47 -07:00
Adam Barth
f9a7ed047d Reattach fitness to the build
We can build Fitness again now that playfair has been updated to account for
the package:flutter rename.
2015-10-12 00:24:24 -07:00
Adam Barth
ecce1eb389 Import dart:ui as ui (instead of as sky) 2015-10-09 20:55:54 -07:00
Adam Barth
65eba90843 Rename package:sky to package:flutter 2015-10-09 20:44:52 -07:00
Adam Barth
5b37f8750d Rename dart:sky to dart:ui 2015-10-09 19:27:13 -07:00
Adam Barth
db3b9e8052 Rename App to MaterialApp
MaterialApp assumes that you're using material design.

Also move radial reaction and fix imports for stats box.
2015-10-09 10:27:22 -07:00
Adam Barth
cc809491ba Split material design widgets out of widgets.dart
These are now part of material.dart.
2015-10-09 10:07:06 -07:00
Hans Muller
09d26302cb IndexedStack
Added horizontal and vertical alignment properties to Stack so that the origin of non-positioned children can be specified. Currently all of the non-positioned children just end up with their top-left at 0,0. Now, for example, you can center the children by specifying verticalAlignment: 0.5, horizontalAlignment: 0.5.

Added IndexedStack which only paints the stack child specified by the index property. Since it's a Stack, it's as big as the biggest non-positioned child. This component will be essential for building mobile drop down menus.

Added a (likely temporary) example that demonstrates IndexedStack.
2015-10-08 10:21:24 -07:00
Hixie
d45bf1457c HomogeneousViewport support for Theme.of()
Previously, RenderObjectElements didn't support being marked dirty. This
is fine, except for MixedViewport and HomogeneousViewport, which have
builder functions to which they hand themselves as a BuildContext. If
those builder functions call, e.g., Theme.of(), then when the theme
changes, the Inherited logic tries to tell the RenderObjectElement
object that its dependencies changed and that doesn't go down well.

This patch fixes this by making RenderObjectElement a BuildableElement,
and making MixedViewport and HomogeneousViewport hook into that to
rebuild themselves appropriately.

Also, this was only found at all because ThemeData didn't implement
operator==, so we were aggressively marking the entire tree dirty all
the time. That's fixed here too.

Also, I changed card_collection.dart to have more features to make this
easier to test. This found bugs #1524, #1522, #1528, #1529, #1530, #1531.
2015-10-07 15:53:50 -07:00
Adam Barth
89a09822bf Simplify Scaffold
Rather than using a custom render object, we can just use a Stack.
2015-10-06 10:06:17 -07:00
Hixie
90a0f6300f Simplify the usage of Navigator's routes argument
(These are changes cherry-picked from in-flight branches since they are
more independent and could be helpful even without those changes.)

- Change RouteBuilder's signature to take a single argument in which the
  other fields are placed, so that we can keep iterating on those
  arguments without having to break compatibility each time. Also, this
  makes defining route builders much simpler (only one argument to
  ignore rather than a variable number).

- Expose the next performance to RouteBuilders, since sometimes the
  route itself might not be where it's used.

- Allow BuildContext to be used to walk children, just like it can for
  ancestors

- Allow BuildContext to be used to get the Widget of the current
  BuildContext

- Allow StatefulComponentElement to be referenced with a type
  specialisation so that you don't have to cast when you know what the
  type you're dealing with actually is.
2015-10-05 13:59:30 -07:00
Adam Barth
3a31f5f772 Give Interval a Curve to apply between start and end
This patch simplifies AnimationTiming and all the AnimatedValue base classes.
Also, make PopupMenu a stateless component because it has no state.

Fixes #1168
2015-10-05 12:10:48 -07:00
Adam Barth
3f82552d22 Improves names of animation classes
Fixes #1170
2015-10-05 10:51:43 -07:00
Adam Barth
49c4787698 Convert Drawer to using navigator
This patch converts drawer to using the "openDialog" pattern for managing its
state. Currently, the drawer entrance and exit animation aren't integrated with
the navigator's animation system because the drawer's animations can be stopped
and reversed, which the navigator can't yet understand. That means dismissing
the drawer via the system back button causes the drawer to be removed
instanteously.

Fixes #715
Fixes #1187
2015-10-05 10:24:19 -07:00
Adam Barth
db191e96bd Switch scheduler over to Duration
This patch prepares us to switch to using integers when handing off the
animation time from the engine to the framework.
2015-10-03 13:48:57 -07:00
Adam Barth
e9aabcd5c6 Use }) : super consistently
Fixes #1372
2015-10-02 23:12:03 -07:00
Hans Muller
4de0a99b3f ShaderMask
The ShaderMask widget enables rendering its child with an alpha channel defined by a Shader. For example if the Shader was a linear gradient in alpha then the component behind the ShaderMask's child would appear wherever the gradient's alpha value was not fully opaque.

The card_collection.dart example demonstrates this. Select the "Let the sun shine" checkbox in the app's drawer.
2015-10-02 17:08:00 -07:00
Hixie
894a1ca09f Draggable offsets and fix default drag feedback
You can now set an offset that will be used for the hit testing for
drops. (It doesn't move the feedback by default; use a Transform for
that.) I also made the default feedback not be Opacity 0.5 always.
2015-10-01 17:13:03 -07:00
Ian Hickson
eda8792542 Merge pull request #1437 from Hixie/mixed_viewport_demo
Remove the mixed_viewport demo
2015-10-01 13:22:45 -07:00
Hixie
13ffcaff2f Remove the mixed_viewport demo
It's redundant with card_collection.dart, which does similar things but
much better.
2015-10-01 12:53:34 -07:00
Hixie
4d186e3c28 Port overlay_geometry.dart demo.
This removes GlobalKey.currentElement in favour of GlobalKey.currentContext.
2015-10-01 12:50:49 -07:00
Adam Barth
45c906d2ad Make fn3 the default widget framework 2015-10-01 09:48:35 -07:00
Collin Jackson
b05d42c3b9 Merge pull request #1220 from collinjackson/scaling_focus
Ensure that the item under the focal point stays in the same place despite zooming
2015-10-01 07:27:54 -07:00
Hans Muller
4ac052357f Snap scrolling: additional tests, cleanup 2015-09-30 14:13:11 -07:00