1585 Commits

Author SHA1 Message Date
Hans Muller
02152f65fb Fix _scrollOffsetIsInBounds analayzer warning 2015-09-29 14:21:57 -07:00
Hans Muller
42f48b0f0e Fix _scrollOffsetIsInBounds analayzer warning 2015-09-29 14:17:23 -07:00
Collin Jackson
1d66184285 Merge pull request #1393 from collinjackson/back_button
pressing back button should close app if there is no previous route
2015-09-29 12:32:04 -07:00
Collin Jackson
c569758a9a pressing back button should close app if there is no previous route 2015-09-29 12:28:28 -07:00
Hans Muller
e24b4e33e3 -straggler- Rename Scrollbehavior release() to createFlingScrollSimulation() 2015-09-29 12:14:19 -07:00
Hans Muller
c3510b7d94 Rename Scrollbehavior release() to createFlingScrollSimulation() 2015-09-29 11:45:18 -07:00
Hans Muller
7385641f6d 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
Devon Carew
ebd7fa3e36 Merge pull request #1375 from devoncarew/customize_dartdoc
customize the generated dartdoc to look like flutter.io
2015-09-28 12:01:54 -07:00
Adam Barth
64dfb8496c Actually notify GlobalKey listeners in fn3
This patch makes a number of changes:

1) buildDirtyComponents now prevents all calls to setState, not just those
   higher in the tree. This change is necessary for consistency with
   MixedViewport and HomogeneousViewport because those widgets already build
   subwidgets with that restriction. If the "normal" build didn't enforce that
   rule, then some widgets would break when put inside a mixed or homogeneous
   viewport.

2) We now notify global key listeners in a microtask after beginFrame. That
   means setState is legal in these callbacks and that we'll produce another
   frame if someone calls setState in such a callback.
2015-09-27 17:22:48 -07:00
Devon Carew
e7f726c240 customize the generated dartdoc like flutter.io 2015-09-26 23:19:25 -07:00
Adam Barth
f9b5b145f9 Address review comments from @hixie 2015-09-26 20:18:16 -07:00
Adam Barth
6ea83f11c8 Merge pull request #1367 from abarth/update_navigation_example
Update navigation example
2015-09-26 18:39:33 -07:00
Adam Barth
fb58141dc5 Port hello_world to fn3 2015-09-26 13:18:20 -07:00
Adam Barth
bb8e82d053 Port address_book to fn3 2015-09-26 13:16:33 -07:00
Adam Barth
1424f351d9 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
a01aa6ffbb Fix analyzer warnings 2015-09-26 13:07:31 -07:00
Adam Barth
c177ecd86c Add missing export 2015-09-26 13:07:21 -07:00
Adam Barth
e510425609 Add missing .gitignore file 2015-09-26 12:54:17 -07:00
Adam Barth
8e201d7552 Port MineDigger to fn3 2015-09-26 12:53:14 -07:00
Adam Barth
a74d02dadf Rename Sky to Flutter in a few more places 2015-09-26 12:46:03 -07:00
Hixie
0a0a92eb45 Port stocks to fn3 and introduce an App component. 2015-09-25 17:52:33 -07:00
Adam Barth
93f1ba5dac Add Mimic to fn3 2015-09-25 16:43:22 -07:00
Adam Barth
24171915aa Fix indent 2015-09-25 15:43:03 -07:00
Adam Barth
e1b8f0b659 Add UniqueComponent helper for creating components with unique states 2015-09-25 15:36:25 -07:00
Adam Barth
ff5676952e Add an onScroll callback to Scrollable 2015-09-25 15:08:22 -07:00
Hixie
a765507c9d fn3: Port Card Collection demo
Also:

- Make Dismissable report when it starts squashing, since otherwise we
  don't invalidate the list early enough and it gets mad that it wasn't
  told one of its children had changed size.

- Have Dismissable check that it gets removed after it's dismissed, to
  avoid having lots of redundant widgets around.

- Start tracking the height of each child of a MixedViewport, so that we
  don't accumulate floating point errors when a child jiggles up and down.

- Have _childOffsets reuse its storage space rather than newing up a new
  copy each time we reset the cache.

- Avoid double-updating child sizes when handling mixed viewport invalidations.
2015-09-25 14:44:54 -07:00
Adam Barth
af8019bf69 Merge pull request #1355 from abarth/current_state
Add a currentWidget and currentState accessor to GlobalKeys
2015-09-25 14:22:39 -07:00
Adam Barth
80997a68d6 Add a currentWidget and currentState accessor to GlobalKeys 2015-09-25 14:22:22 -07:00
Adam Barth
6c3b20be8e Merge pull request #1354 from abarth/fn3_ensure_widgets_is_visible
Add ensureWidgetIsVisible to fn3
2015-09-25 14:21:27 -07:00
Adam Barth
3387bbaa37 Add ensureWidgetIsVisible to fn3 2015-09-25 14:21:12 -07:00
Viktor Lidholt
55dc7108a5 Merge pull request #1351 from vlidholt/master
Renames pointQuickDist in GameMath
2015-09-25 13:50:48 -07:00
Hans Muller
91cb07f649 Merge pull request #1353 from HansMuller/bump_newton_version
Bumped Newton version to 0.1.4
2015-09-25 13:45:44 -07:00
Adam Barth
d717be946a Add findRenderObject to BuildContext 2015-09-25 13:37:14 -07:00
Hans Muller
b64989e96f Bumped Newton version to 0.1.4 2015-09-25 13:32:37 -07:00
Viktor Lidholt
0cb811ef06 Renames pointQuickDist in GameMath 2015-09-25 13:12:01 -07:00
Adam Barth
ee45832818 Rev pub package 2015-09-25 12:04:25 -07:00
Adam Barth
fd18f76b20 Merge pull request #1346 from abarth/fn3_sync_tests
Port some more tests to fn3
2015-09-25 11:58:12 -07:00
Adam Barth
d19e86f0a9 Merge d8ea1b194b446f555402770acd8ac6b217becb7c to fn3 2015-09-25 11:57:30 -07:00
Adam Barth
4ad83fa059 Port some more tests to fn3 2015-09-25 11:27:48 -07:00
Andrew Wilson
75061728e6 Merge pull request #1342 from apwilson/fling
Add fling to Scrollable.
2015-09-25 11:18:53 -07:00
Andrew Wilson
d771927219 Add fling to Scrollable. 2015-09-25 11:15:24 -07:00
Adam Barth
96b0801c7b Merge pull request #1345 from abarth/fn3_more_tests
Port some more tests to fn3
2015-09-25 10:56:53 -07:00
Adam Barth
7d02880cf4 Port some more tests to fn3 2015-09-25 10:51:56 -07:00
Adam Barth
0768ea973e Merge pull request #1341 from abarth/fn3_editing
Port Input and EditableText to fn3
2015-09-25 10:51:31 -07:00
Hixie
5f9cb4aa38 Port ScrollableMixedWidgetListState to fn3. 2015-09-25 10:27:43 -07:00
Adam Barth
481b764f67 Port Input and EditableText to fn3 2015-09-25 10:08:29 -07:00
Adam Barth
fe77808d08 Copy Input and EditableText into fn3 2015-09-25 10:06:59 -07:00
Adam Barth
06ffa75919 Convert some tests to fn3 2015-09-25 09:29:04 -07:00
Adam Barth
b5893f9e13 Fix typos in fn3 2015-09-25 08:42:39 -07:00
Adam Barth
52ce67b977 Merge pull request #1336 from abarth/fn3_more_examples
Port even more examples to fn3
2015-09-24 16:11:56 -07:00