1699 Commits

Author SHA1 Message Date
Adam Barth
0033a8fcdf Enable more asserts when building with virtual viewports 2016-01-06 16:03:26 -08:00
Adam Barth
e64d93a520 Switch PageableList over to using RenderList
This patch moves PageableList off HomogeneousViewport and onto RenderList and
friends, making it match the new ScrollableList.
2016-01-06 15:28:01 -08:00
Adam Barth
627c1ffb5c Replace ScrollableList with ScrollableList2
ScrollableList2 is complete and subsumes all the use cases for the original
ScrollableList.
2016-01-06 11:16:57 -08:00
Hans Muller
6494cd1f35 Make TabBarSelection a parameterized type 2016-01-06 10:54:16 -08:00
Adam Barth
d2a1389ed0 Fix assert in Stocks app
When paging a scrollable list, we were trying to read the render object's size
at a time when we're not allowed to read it. Instead, encode the information
into the repaint limit, which is more correct (and faster) anyway.
2016-01-06 10:44:19 -08:00
Adam Barth
b1f9138f52 Switch clients of ScrollableList to ScrollableList2
This patch also changed ScrollableList2 to use an Iterable instead of an
List for its children. This change lets clients map their underlying
data lazily. If the clients actually have a concrete list, we skip the
extra copy and grab the child list directly.
2016-01-05 16:21:00 -08:00
Adam Barth
37106ea603 Complete features of ScrollableList2
This patch implements the remaining missing features of ScrollableList2.
It should now be nearly a drop-in replacement for ScrollableList. The
next patch will switch callers over to the new machinery.
2016-01-05 14:29:12 -08:00
Adam Barth
7aa575b0d4 Remove ScrollDirection.both
Almost none of the clients of ScrollDirection can handle scrolling in both
directions.

Fixes #151
2016-01-04 16:46:40 -08:00
Adam Barth
24fadf49fc Merge pull request #1070 from abarth/scrollable_list2
Introduce ScrollableList2
2016-01-04 16:44:44 -08:00
Adam Barth
99bca282c9 Introduce ScrollableList2
ScrollableList2 uses the same pattern as ScrollableGrid, which requires the
client to allocate widgets for every list item but doesn't inflate them unless
they're actually needed for the view. It improves on the original
ScrollableList by not requiring a rebuild of the whole visible portion of the
list when scrolling. In fact, small scrolls can often be handled entirely by
repainting.
2016-01-04 16:34:39 -08:00
Ian Hickson
c8ac09a56d Merge pull request #1042 from Hixie/wordSpacing
Hook up wordSpacing and inline height.
2016-01-04 15:38:56 -08:00
Ian Hickson
1156bd254f rev engine 2016-01-04 13:53:23 -08:00
Adam Barth
6106fa9d6d Add support for scrollable grids
We now support (vertically) scrollable grids with viewporting. If the
scroll doesn't reveal any new rows, we execute the scroll with a repaint
(i.e., no layout). If the scroll reveals a new row, we trigger a layout
to change the set of materialized children in the viewport.
2016-01-04 11:23:42 -08:00
Ian Hickson
b1bd8017b4 Change how we provide additional information for asserts in the Widget framework.
Fixes #1058.
2016-01-03 21:22:34 -08:00
Adam Barth
46a178dce6 Generalize grid layout
This patch make grid layout much more flexible. The behavior is factored
out into a GridDelegate that's modeled after the custom layout
delegates. The patch includes a MaxTileWidthGridDelegate that implements
the old behavior and a FixedColumnCountGridDelegate that implements a
grid layout with a fixed number of columns.

Fixes #1048
2016-01-02 14:30:45 -08:00
Adam Barth
e9ac6d308d RenderBox should use Offset for child offset
Previously we used Position, which makes it harder to accumulate offsets
when walking the render tree.
2016-01-01 20:11:38 -08:00
Adam Barth
31bc220d3b Merge pull request #1057 from abarth/fix_assert
ScrollbarPainter exception when scrolling MaterialList
2016-01-01 19:39:59 -08:00
Adam Barth
9484370042 ScrollbarPainter exception when scrolling MaterialList
When assigning a new overlayPainter, we were detaching the old overlay
painter even if the render object itself wasn't attached. Now we only
twiddle the attach/detach state of the overlay painter when we're
attached ourselves.

Fixes #1047
2016-01-01 19:33:03 -08:00
Adam Barth
ab614847f7 Ink well in ListItem doesn't fill MaterialList
We need to put the padding on the inside of the list item.

Fixes #1055
2016-01-01 16:17:01 -08:00
Ian Hickson
7df2dfcaf7 Improve diagnostics around misuse of ParentDataWidgets.
Fixes https://github.com/flutter/flutter/issues/572
2015-12-30 16:23:15 -08:00
Ian Hickson
4588524ca7 Hook up wordSpacing and inline height.
Also, trivial improvements to the baseline example that I made while
unsuccessfully trying to reproduce a baseline bug.
2015-12-30 12:05:44 -08:00
Ian Hickson
b1dae4c4cc Various Input and Focus fixes
Require a Key on Input.

Simplify the API for Focus.at() and Focus.moveTo().
Fixes #236.
This will require an e-mail to flutter-dev.

Make Input grab focus onTap not onPointerDown.
Fixes #189.

Complain when you use Focus.at() with two different GlobalKeys that
are both in the tree at the same time.
Fixes #181.

Add dartdocs for Focus.moveTo() and Focus.moveScopeTo().
2015-12-28 15:05:51 -08:00
Ian Hickson
c812628806 Merge pull request #1024 from Hixie/transform
Catch dismissable while it's animating.
2015-12-26 11:54:18 -08:00
Eric Seidel
37142842e0 Add documentation for GridPaper
I'm not actually sure what this is useful for, but I took a stab at it.

@Hixie
2015-12-25 17:16:33 -08:00
Ian Hickson
5d9d521707 Catch dismissable while it's animating.
Fixes #173.
2015-12-24 23:13:55 -08:00
Ian Hickson
9bad312af2 RenderFractionalTranslation
- Add RenderFractionalTranslation, a render box that does a
  translation based on a FractionalOffset.

- Make FractionalOffset more like Offset
  - dx/dy instead of x/y
  - add /, ~/, %
  - add .zero

- Add alongOffset and alongSize to FractionalOffset so that you can
  easily apply FractionalOffset to Offsets and Sizes. (Better name
  suggestions welcome.)

- Add transformHitTests boolean to RenderTransform (also on
  RenderFractionalTranslation), and to classes based on it.

- Remove the fade from Dismissable. We can add it back using the
  builder-with-child pattern like Draggable if we need it. See #1003
  for tha feature request.

- Rename a bunch of variables in dismissable.dart.

- Change the test for dismissable to not handle leftwards dismisses
  one pixel different from rightwards dismisses, and cleaned up the
  resulting effect on the test (mostly making sure we had the right
  number of pumps, with comments explaining what each one was).

Fixes #174.
2015-12-24 11:04:25 -08:00
Hans Muller
6178fdff8a TabBarSelection is now expected to be an ancestor of its TabBar and TabBarView. 2015-12-22 14:12:26 -08:00
Hans Muller
3f32201c66 checkpoint 2015-12-21 16:29:43 -08:00
Devon Carew
7970df5907 Merge pull request #1008 from devoncarew/fix_analysis_errors
fix analysis errors and warnings in the stocks example
2015-12-21 14:03:35 -08:00
Devon Carew
6e324ef92d fix analysis errors and warnings in the stocks example 2015-12-21 13:39:28 -08:00
Seth Ladd
2bc0a05959 Merge pull request #1000 from flutter/sethladd-patch-1
Add a doc comment for Performance's repeat()
2015-12-21 12:51:34 -08:00
Seth Ladd
93053c062d Merge pull request #1001 from flutter/sethladd-patch-2
Link Curve to Curves in doc comments
2015-12-21 12:51:18 -08:00
Ian Hickson
e48efdca15 Merge pull request #982 from Hixie/fewer-bit-updates
Less tree walking for compositing bits updates.
2015-12-21 11:33:11 -08:00
Seth Ladd
c6fc6d2aa0 Link Curve to Curves in doc comments 2015-12-20 11:45:21 -08:00
Seth Ladd
96ae6d65ef Add a doc comment for Performance's repeat()
How's this?
2015-12-20 11:33:10 -08:00
Ian Hickson
543a7df0f6 Update RenderPositionedBox documentation. 2015-12-19 21:07:36 -08:00
krisgiesing
b53ab6485d Merge pull request #995 from krisgiesing/minor_cleanup
Remove redundant typedef
2015-12-18 13:48:02 -08:00
Kris Giesing
3b3315f46e Remove redundant typedef 2015-12-18 13:40:59 -08:00
Hixie
ab01c7bf73 Less tree walking for compositing bits updates.
Use the same technique for updating compositing bits as layout and
painting. This avoids walking the entire rendering tree when all you
need to update is a small subtree.
2015-12-17 13:55:53 -08:00
Hans Muller
65dca5b578 Correct the TabBarView swipe selection change animation
The TabBarSelection change animation needs to start where the fling's drag gesture ended rather than from zero.  The intial vlaue of progress for the TabBarSelection's performance is now converted from the range used during an interactive drag, to the range used when animating from the previously selected tab to the new one.

TabBarSelection now requires a maxIndex parameter.
2015-12-16 15:30:45 -08:00
Ian Hickson
1327be6908 Merge pull request #968 from Hixie/scaffold-without-navigator
Make Navigator.canPop handle the no-navigator case
2015-12-16 14:58:00 -08:00
Hixie
a0d6572977 Make Navigator.canPop handle the no-navigator case
Scaffold calls this to see if it should show a back arrow when there's
no drawer. With this change, everything continues to work.

Fixes styled_text and probably others.
2015-12-16 14:34:24 -08:00
Hixie
b5e7e1ce7a Close some sentences. (rendering dartdocs) 2015-12-16 13:30:33 -08:00
Jason Simmons
e880bd92fb Support application lifecycle state change events in the framework 2015-12-16 12:38:40 -08:00
Ian Hickson
b8562aba60 Merge pull request #954 from Hixie/unit-to-flutter
Move flutter tests from packages/unit to packages/flutter/test
2015-12-16 09:44:01 -08:00
Ian Hickson
7dad780f13 Merge pull request #946 from Hixie/pointerExceptions
Catch exceptions in pointer handling
2015-12-16 09:42:15 -08:00
Ian Hickson
7ea5879e88 Merge pull request #920 from Hixie/renderView-non-null
Be clearer about whether renderView can be null.
2015-12-16 09:42:04 -08:00
Ian Hickson
7151fdd054 Move flutter tests from packages/unit to packages/flutter/test 2015-12-16 08:00:57 -08:00
Ian Hickson
1d39db6959 Merge pull request #950 from Hixie/dropdown-asserts
Aggressively try to catch misuse of DropDownButton
2015-12-15 21:54:17 -08:00
Hixie
0c6e3416d8 Canceling a dropdown menu selects null value
Previously we didn't distinguish between canceling the menu (which
popped the route with no return value, i.e. null) and explicitly
selecting an item whose value is null (pop with value null). Both fired
onChange(null).

Now we box the return value so we can distinguish the two cases.

I would have preferred to just disallow "null" as a value but it turns
out people like being able to use "null" as a value for much the same
reason we do, and it seems best for us to pay the complexity cost of
boxing than having everyone else do it. :-)
2015-12-15 16:52:58 -08:00