271 Commits

Author SHA1 Message Date
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
Viktor Lidholt
4a7e6e9bcf Updates work with latest Flutter changes 2015-10-02 15:10:02 -07:00
Viktor Lidholt
b3dc369bd0 Sprite physics, first iteration 2015-10-02 14:15:14 -07:00
Hixie
68f0b69bd0 Groundwork for heroes transition in Stocks app
Identify specific parts of a Stock row with a Global Key that can be
regenerated later, and pass that key back to event handlers so they can
use them to do the transition.
2015-10-02 10:20:08 -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
Adam Barth
55481ed387 Merge pull request #1444 from abarth/float64
Moves from vector_math to vector_math_64
2015-10-01 15:37:20 -07:00
Hixie
3e0c6d586e EdgeDims changes and other fixes to core classes.
- Rename EdgeDims constructor to EdgeDims.TRBL().

- Add operator== to Size and Offset so that you can compare Size to
  DebugSize in checked mode.

- Add Size.lerp().

- Add various operators to EdgeDims. (*, /, ~/, %)

- Add EdgeDims.lerp().

- Update style guide. I went there to fix an EdgeDims constructor
  example, and stayed because some recent things came up and I wanted to
  add them before I forgot.
2015-10-01 15:34:04 -07:00
Adam Barth
8cf43b65d2 Moves from vector_math to vector_math_64
* Moves from vector_math to vector_math_64
* Adds support for Float64List in Dart bindings
2015-10-01 14:46:13 -07:00
Hixie
7ff632d140 Stocks app used RouteState, now renamed StateRoute 2015-10-01 13:31:18 -07:00
Collin Jackson
ef32f71b80 Merge pull request #1434 from collinjackson/decode_lists
Support for decoding images in lists
2015-10-01 13:24:08 -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
Collin Jackson
8af98ef93c Fix spinning_image URL to one that works 2015-10-01 13:16:53 -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
2df5d1ada7 Update playfair to a version that supports fn3 2015-10-01 09:54:31 -07:00
Adam Barth
feb70684f5 Make fn3 the default widget framework 2015-10-01 09:48:35 -07:00
Adam Barth
d7e3388b13 Remove unused imports 2015-10-01 09:30:31 -07:00
Adam Barth
9d63bb1381 Port SkySprites and clients to fn3 2015-10-01 09:26:19 -07:00
Adam Barth
c5e8833b4e Port demo_launcher and fitness to fn3 2015-10-01 09:07:17 -07:00
Adam Barth
63766316c6 Merge pull request #1416 from mdakin/minedigger2
Fix bounds checking error I introduced in previour cl, Address style …
2015-10-01 08:30:36 -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
mdakin
2e562b95c1 Fix bounds checking error I introduced in previour cl, Address style issues. 2015-09-30 23:15:55 +02: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
Ian Hickson
a406c96f76 Merge pull request #1405 from Hixie/dynamic-routes
Dynamic named routes
2015-09-30 09:54:27 -07:00
Hixie
1357f2bb4c Dynamic named routes
Make it possible for named routes to be generated on the fly.

To demonstrate this, you can now long-press a stock to open it.

Next steps:

 - transitions between (named) states that follow full material logic,
   e.g. in the case of the stock row to stock page transition, expanding
   the row into a raised sheet of material and expanding it to fit the
   screen, leaving the toolbar in place but cross-fading the old
   contents to the new contents.

 - more information in the stock view.

While I was here I also made Material have an opinion about default text
style, so if you forget to set one, it just uses body1.

Also, fixed bugs introduced recently that made RouteState and MenuRoute
not work properly.
2015-09-30 09:03:58 -07:00
mdakin
0d6170a235 Fix alignment of mine counts, simplfy code a bit. 2015-09-30 15:11:42 +02:00
Ian Hickson
c34763f8e7 Merge pull request #1403 from Hixie/clickable-stocks
Make Stocks demo list rows clickable
2015-09-29 22:32:00 -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
Hixie
f18fa35b4a Make Stocks demo list rows clickable
Not having them clickable was making it hard to notice InkSplash bugs.
Also, this paves the way to having a stock page.
2015-09-29 17:55:27 -07:00
Ian Hickson
71e96c4a02 Merge pull request #1386 from Hixie/toString
fn3: toString() and toStringDeep() debugging aids
2015-09-29 17:09:54 -07:00
Ian Hickson
8b0e60e258 Merge pull request #1376 from Hixie/toggleable
Make the checkbox in the stocks popup menu work.
2015-09-29 17:08:36 -07:00
Ian Hickson
6def36ca57 Merge pull request #1371 from Hixie/fab-snack
Make the FAB move up when a Snack Bar slides in.
2015-09-29 15:23:49 -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
Hixie
cce3801677 fn3: toString() and toStringDeep() debugging aids 2015-09-28 17:09:26 -07:00
Hixie
4942bf35e9 Make the checkbox in the stocks popup menu work.
Tapping on the menu item didn't animate the checkbox because the menu
takes 300ms to animate entirely away while the checkbox takes 200ms to
animate checked, and since the item with the checkbox was at the bottom,
we were only seeing about 60ms of the entire checkbox animation, which
isn't enough to notice it. So I moved it to the top of the menu.

Tapping on the checkbox didn't animate because nothing caused the menu
to rebuild when the callback was invoked. To trigger a rebuild, I now
call navigator.setState() explicitly, after changing out local state.

To make tapping the checkbox remove the menu, I also explicitly call
navigator.pop() in the code that handles the check. (I still explicitly
change the checkbox to show that that's possible. In principle one could
just treat the checkbox as an inert widget that happens to trigger pop,
and do all the checking/unchecking in the switch statement.)

I also made some minor style tweaks to files I was looking at while
dealing with this issue.
2015-09-28 11:15:05 -07:00
Hixie
e7ddb4ce78 Make the FAB move up when a Snack Bar slides in.
This changes how SnackBar works so you can use it anywhere, not just on
the bottom edge of the screen (it used to rely on overflowing its bounds
and having negative offsets... I'm not really sure how hit testing
worked on it before!).

To do this I introduced a new RenderBox, RenderOverflowBox, that lets
you set your child's size independent of your own. I needed this so that
the snack bar could use a SquashTransition to change its size, while not
affecting the layout of its child. This is exposed as OverflowBox in
fn3. I'm not sure if it's the best API. It doesn't let you position the
child (which is an issue if the size you give is smaller), it doesn't
let you give a loose constraint (which maybe you might want?). But it
handles this use case, so for now it's probably ok.

Making the FAB get repositioned out of the way of the Snack Bar is now
done in the Scaffold, which is in charge of positioning both of those
and is the place that knows that both exist.
2015-09-28 10:19:22 -07:00
Adam Barth
31585045ea Merge pull request #1367 from abarth/update_navigation_example
Update navigation example
2015-09-26 18:39:33 -07:00
Adam Barth
88b797bf1c Port hello_world to fn3 2015-09-26 13:18:20 -07:00
Adam Barth
f005958b72 Port address_book to fn3 2015-09-26 13:16:33 -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
43349f82f6 Fix analyzer warnings 2015-09-26 13:07:31 -07:00
Adam Barth
4a13cf5d1f Port MineDigger to fn3 2015-09-26 12:53:14 -07:00
Adam Barth
198f23cb53 Rename Sky to Flutter in a few more places 2015-09-26 12:46:03 -07:00
Hixie
d8ef78edcf Port stocks to fn3 and introduce an App component. 2015-09-25 17:52:33 -07:00
Viktor Lidholt
367935b777 Merge pull request #1351 from vlidholt/master
Renames pointQuickDist in GameMath
2015-09-25 13:50:48 -07:00
Viktor Lidholt
05f31c7259 Renames pointQuickDist in GameMath 2015-09-25 13:12:01 -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