74 Commits

Author SHA1 Message Date
Adam Barth
6601b5dfa9 Simplify Scaffold
Rather than using a custom render object, we can just use a Stack.
2015-10-06 10:06:17 -07:00
Hixie
3467f32a1f 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
80d1218487 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
bcb0fe2fed Improves names of animation classes
Fixes #1170
2015-10-05 10:51:43 -07:00
Adam Barth
ec890ace01 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
75d4ee7eb6 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
7b230cd127 Use }) : super consistently
Fixes #1372
2015-10-02 23:12:03 -07:00
Hans Muller
c985ed6739 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
d726c2780d 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
d51d8197a4 Merge pull request #1437 from Hixie/mixed_viewport_demo
Remove the mixed_viewport demo
2015-10-01 13:22:45 -07:00
Hixie
7f6897a190 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
1c24af030c Port overlay_geometry.dart demo.
This removes GlobalKey.currentElement in favour of GlobalKey.currentContext.
2015-10-01 12:50:49 -07:00
Adam Barth
feb70684f5 Make fn3 the default widget framework 2015-10-01 09:48:35 -07:00
Collin Jackson
387ddf16b7 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
b77990cc2e Snap scrolling: additional tests, cleanup 2015-09-30 14:13:11 -07:00
Adam Barth
05d4f1b8aa Remove BuildContext argument to initState
This argument isn't needed anymore now that State has a getter for context.
2015-09-30 13:15:46 -07:00
Hixie
a7443e75a5 Draggable
Introduce a Draggable class that wraps all the logic of dragging
something and dropping it on a DragTarget.

Update examples/widgets/drag_and_drop.dart accordingly.

Make the performance/transition part of routes optional.
2015-09-29 18:00:40 -07:00
Hans Muller
68b00481a1 SnapOffsets for fling Scrolling
Initial snap offset support for ScrollableWidgetList (and ScrollableList<T>) and ScrollableMixedWidgetList. If a ```toSnapOffset(scrollOffset)``` function is provided, fling Scrolls will coast to the returned value. If ```alignmentOffset``` is specified then fling scrolls conclude when toSnapOffset's value lines up with the Scrollable widget's origin + alignmentOffset. For example if the Scrollable widget's height was 200.0, and alignmentOffset:100.0 was specified, then fling scrolls would end with the value returned by toSnapOffset() lined up with the center of the Scrollable.

This approach to Scrollable snapping assumes that the layout of whatever the Scrollable contains is known at the outset. This is often true however a ScrollableMixedWidgetList may not know its items' sizes until they've been reached by scrolling.

This is a first cut at snapping support. Among the things that remain to be done:
- Scrolling limits trump snapping. Snapping should probably trump scrolling limits.
- Drag scrolls aren't snapped. This may be desirable so perhaps the feature should be controlled with a flag.
- Specifying alignmentOffset as a percentage would probably be more convenient.
- It would be nice if one could wrap items in a SnapOffset value like: ```new SnapOffset(0.5, child: myItem)``` to snap to the center of the item.

Updated the CardCollection example: snapping and fixed size items can be turned on/off with Drawer checkboxes.
2015-09-29 11:09:59 -07:00
Adam Barth
16706a94ae Update navigation example after Navigator changes
Now this example uses the App widget to drive the adventure game.
2015-09-26 13:07:46 -07:00
Adam Barth
198f23cb53 Rename Sky to Flutter in a few more places 2015-09-26 12:46:03 -07:00
Hixie
8c8837d63e Port ScrollableMixedWidgetListState to fn3. 2015-09-25 10:27:43 -07:00
Adam Barth
c54f91ea3b Fix typos in fn3 2015-09-25 08:42:39 -07:00
Adam Barth
6890b652c5 Port even more examples to fn3 2015-09-24 16:09:37 -07:00
Hixie
086a53d38f Rename ComponentState and use initState().
ComponentState becomes State, for brevity.
Instead of overriding its constructor, override initState().
This makes writing States much simpler.
2015-09-24 16:00:51 -07:00
Adam Barth
3f622d8b09 Port some more examples to fn3 2015-09-24 15:43:40 -07:00
Adam Barth
0eccf690ad Port Date Picker example to fn3 2015-09-24 14:46:29 -07:00
Adam Barth
fb2c9e3c95 Port big_switch.dart to fn3 2015-09-24 13:29:40 -07:00
Adam Barth
c94726ec32 Remove EventDisposition
All the use cases for EventDisposition are now addressed by the gesture
detection system.
2015-09-21 16:45:09 -07:00
Hixie
8dcec9bf93 Require that you pass transitions a performance.
This fixes #1103.
2015-09-18 10:30:47 -07:00
Adam Barth
9cef3e61e9 Move theme into material.dart
Also, introduce Colors and Typography to hold the material colors and the
typography declarations. Previously we expected clients of these libraries to
import them into a namespace, but that doesn't play nice with re-exporting them
from material.dart.
2015-09-18 09:57:21 -07:00
Collin Jackson
b844773280 Ensure that the item under the focal point stays in the same place despite zooming 2015-09-17 14:36:48 -07:00
Adam Barth
0cc094288e Move mojo frontend into services.dart
What's important about this code is that it's presenting services outside the
VM, not the particular technology used to present the services.
2015-09-16 19:13:50 -07:00
Collin Jackson
aa6251a276 Update scale API and add example 2015-09-16 17:20:23 -07:00
Adam Barth
db9c46213b Remove MimicOverlay
This widget has no client.
2015-09-16 09:27:50 -07:00
Adam Barth
8a652df63e Add dartdoc for proxy_box.dart and other code in rendering
Almost done adding dartdoc to the rendering layer.
2015-09-14 10:35:31 -07:00
Adam Barth
305fb7e10f Add some more docs to the rendering library 2015-09-11 15:09:38 -07:00
Adam Barth
ef880695d5 Introduce package:sky/animation.dart
Move the animation libraries into src/animation and change importers to use
package:sky/animation.dart. Also, move scheduler.dart into the animation
library so that the animation library can be self-contained.
2015-09-08 09:44:01 -07:00
Adam Barth
79c280a703 Document and bring sanity to BoxConstraints
Turns out many of the functions on BoxConstraints weren't used or had callers
that could easily be updated to other functions. I've added dartdoc to all the
public functions as well as renamed some functions that had similar names but
did different things.
2015-09-05 11:33:02 -07:00
Hans Muller
f621e01c3b Add Dismissable unit tests 2015-09-04 14:31:03 -07:00
Hans Muller
73361c6be3 Add Dismissable support for DismissDirection
```
enum DismissDirection {
  vertical,
  horizontal,
  left,
  right,
  up,
  down
}
```

To only enable dismissing to the right create the `Dismissable` with `direction: DismissDirection.right`. By default direction is `DismissDirection.horizontal` (left or right).

Updated the card_collection "Swipe Away" demo with a drawer that can be used to select one of the three X axis dismiss directions. Currently the MixedViewport class doesn't support horizontal scrolling, so the demo doesn't support the X axis dismiss directions.
2015-09-04 11:31:15 -07:00
Adam Barth
97aa83b307 Remove lerp.dart
These functions are now in sky:dart.
2015-09-03 12:36:24 -07:00
Hans Muller
953bb509d0 Enable dynamic changes to itemsWrap in PageableList 2015-09-02 16:00:53 -07:00
Hans Muller
527772f18f Update mixed_viewport example to new Key API 2015-08-31 11:37:25 -07:00
Hixie
08b7ea3e3d Rationalise the Key API.
Add a way of having keys based on numeric types or DateTimes by having a ValueKey<T> class.
Remove the redundant ways of declaring things, except for leaving one shorthand -- you can say `new Key(s)` instead of `new ValueKey<String>(s)`.
2015-08-28 13:17:34 -07:00
Adam Barth
9c82589fc3 Use GestureDetector in the framework and examples
We're now using it at the widget layer for everything except scrolling and
flinging.
2015-08-28 10:58:46 -07:00
Adam Barth
433f825ca0 Turn big_circle.dart into a test
Fixes #829
2015-08-26 11:10:16 -07:00
Collin Jackson
5da1afe0b1 Merge pull request #838 from collinjackson/improve_date_picker
Add date picker to widgets library and teach fitness app to use it
2015-08-26 10:28:27 -07:00
Hixie
71e6f53a57 Replace Flex to Row and Column in tests and examples.
This still leaves Flex and FlexDirection available. At some point once
people have transitioned to Row/Column we should rename Flex to _Flex
and stop reexporting FlexDirection from basic.dart.
2015-08-26 09:05:14 -07:00
Collin Jackson
d8690b8cae Add date picker to widgets library and teach fitness app to use it
Also, add an example for the date picker
2015-08-25 16:41:11 -07:00
Adam Barth
d1537172bf Merge pull request #780 from abarth/mimic_improvements
Mimic should track Mimicable more completely
2015-08-24 15:11:34 -07:00