2880 Commits

Author SHA1 Message Date
Adam Barth
7f79cced7e Give more control to SliverChildDelegate (#7885)
This patch moves the resonsibility for wrapping repaint boundaries
around children to SliverChildDelegate, which means delegates can choose
whether or no to use repaint boundaries.

Also introduce SliverChildBuilderDelegate to make it easier to use the
builder pattern with sliver lists.

This functionality will be used by date picker, which wants to use a
SliverGrid but doesn't need a repaint boundary around every day in a
month grid.
2017-02-04 09:34:14 -08:00
weisong0
b339c71523 Allow multiple observers for the Navigator and MaterialApp (#7883)
* allow mulitple observers for Navigator and MaterialApp

* add test for the navigator observers

* fix style

* add test for adding/removing a navigator observer
2017-02-04 00:51:32 -08:00
Adam Barth
ff14f35d6d CustomScrollView (#7881)
Also, use CustomScrollView in Shrine and fix a bug with one-line grids
not painting properly due to their reporiting zero paintExtent.
2017-02-03 22:52:25 -08:00
Adam Barth
667424659d Rename SliverLogicalParentData.scrollOffset to layoutOffset (#7871)
This quantity is actually the layoutOffset of the child, not its scroll offset.
2017-02-03 20:47:16 -08:00
Adam Barth
20402ba70a Remove MaxTileWidthGrid (#7875)
This widget has no clients. Please use GridView.extent instead.
2017-02-03 20:08:09 -08:00
Ian Hickson
471e91d46f SliverBlock->SliverList (#7872) 2017-02-03 17:14:00 -08:00
Adam Barth
f2ea7304c8 PageView shouldn't squish when overscrolled (#7870)
This patch passes down the viewportMainAxisExtent so that RenderSliverPage can
pick it up and size its children appropriately.
2017-02-03 16:43:04 -08:00
Ian Hickson
332a23030b Rename and refactor ScrollView hierarchy (#7865)
This prepares us for a CustomScrollView that takes slivers.
2017-02-03 16:05:43 -08:00
Adam Barth
7fea0593f5 Scrollable2.ensureVisible for box-based viewports (#7868)
This patch makes Scrollable2.ensureVisible with SingleChildScrollView. A future
patch will extend the implementation to work with slivers. (Although the patch
does include some of the infrastructure for that part of the implementation as
well.)
2017-02-03 16:04:41 -08:00
Adam Barth
072cce88d6 Reparameterize Scrollable2 (#7853)
This patch makes a number of changes to how you can configure a
Scrollable2:

 - The ScrollPhysics is now responsible for creating the ScrollPosition.
   You can override the ScrollPhysics by supplying a `physics` argument
   to `Scrollable`, and the new physics you supply will be applied to
   the default physics inherited from the ScrollBehavior.

 - This patch removes the ScrollPosition/AbsoluteScrollPosition split as
   all clients were operating in pixels anyway and the split made the
   code very difficult to follow.

 - ScrollPosition no longer depends directly on Scrollable2State.
   Instead, it depends on an abstract interface that Scrollable2State
   implements. This change has two benefits:

    a) It removes the circular dependency between ScrollPosition and
       Scrollable2State, which lets us split the code for these classes
       (and several other classes that got wrapped up in that cycle) into
       separate libraries for easier maintenance.

    b) ScrollPosition is no longer bound to Scrollable2, which means you
       could use the behavior machinery to drive other sorts of widgets.
       For example, we could use it to drive Scrollabe1 if we wanted.
2017-02-03 14:28:17 -08:00
xster
475e7ce97d Optional general date predicate mechanism (#7858) 2017-02-03 14:27:38 -08:00
Ian Hickson
be7be2b8b6 Test service extensions (#7849)
...and fix bugs that the tests uncovered.

WRITE TEST FIND BUG
2017-02-03 13:55:07 -08:00
Adam Barth
2ec02c3395 Remove Scrollable2.initialScrollOffset (#7842)
This property is wired up to anything and it isn't used. We'll need to find a
better way for clients to control the scroll offset.
2017-02-03 11:18:47 -08:00
Adam Barth
f56c5a3651 Move ViewportOffset to its own file (#7840)
There aren't any interdependencies with the rest of sliver.dart, and that file
is already quite complex.
2017-02-02 17:02:29 -08:00
Adam Barth
3231465769 Add PageView (#7809)
This widget is a start towards replacing PageableList. There are still a number
of features that we'll need to add before this widget can replace PageableList.
2017-02-02 16:16:20 -08:00
Ian Hickson
dc634e195e Introduce the concept of asynchronicity to the service extensions. (#7823)
This allows us, for example, to wait for the slow mode banner to have
been removed from the screen before triggering a screen shot.
2017-02-02 15:48:35 -08:00
Hans Muller
e366c9691f protect the hasScopedWillPopCallback ModalRoute method (#7832) 2017-02-02 15:27:39 -08:00
Ian Hickson
cedc74503a Add a flag that shows a banner for old Scrollables (#7819)
Also, tweak Banner a bit so you can set the color and text style.
Also, cache the text painter between paints.
2017-02-02 14:52:49 -08:00
Ian Hickson
5928d221d4 ShrinkWrap Viewport (#7790) 2017-02-02 14:50:04 -08:00
xster
959db13c04 Prevent out of bound date picker selections (#7773)
- Out of bound days are disabled and untappable
- Out of bounds months can't be navigated to
2017-02-02 11:30:32 -08:00
Mikkel Nygaard Ravn
f460309354 Added Widgets that interact with asynchronous computations (#7733)
Added three widgets that interact with Futures and Streams.
2017-02-02 08:35:36 +01:00
Adam Barth
8b4aed1720 Fix copy/pasta ConstrainedBox docs (#7795)
Fixes #7788
2017-02-01 23:14:05 -08:00
Ian Hickson
5f38773ed0 Screenshot improvements (#7800)
Add an "s" command to `flutter run` which takes a screenshot.
Make that comment turn off the slow mode banner.
2017-02-01 22:47:53 -08:00
Ian Hickson
648f70630c Add more timeline ranges for profiling hot reload (#7792) 2017-02-01 22:47:26 -08:00
Michael Goderbauer
40aab7f553 Bump Dart SDK to 1.22.0-dev.10.3 (#7791) 2017-02-01 16:33:27 -08:00
Adam Barth
b082b93a3f Simplify AbsoluteScrollPosition class structure (#7785)
Instead of using mixins and subclasses, we now use a `ScrollPhysics` delegate
to customize the scrolling phyics for Android and iOS. This change will make it
easier to customize the scroll position for paging.
2017-02-01 15:48:24 -08:00
Adam Barth
fe01c71cf4 Switch clients to ScrollGrid (#7752)
The only remaining client of ScrollableGrid (the old version) is Pesto,
which needs AppBar integration.
2017-02-01 11:01:02 -08:00
Adam Barth
41f1f8a489 Add SliverFill (#7776)
SliverFill fills the remaining space in the viewport with each box
child. We'll use this sliver as a building block for pageable lists.
2017-02-01 10:49:43 -08:00
Adam Barth
695302029f Revert "Revert "Add SliverGrid and ScrollGrid"" (#7780) 2017-02-01 10:18:48 -08:00
Adam Barth
906541c04a Refactor out some helper functions (#7774)
These functions were previously hidden inside other functions but they
are useful enough to expose directly. Specifically, I plan to use these
when implementing Scrollable2.ensureVisible.
2017-01-31 22:46:35 -08:00
Ian Hickson
32784d35f9 Revert "Add SliverGrid and ScrollGrid" (#7769) 2017-01-31 17:34:02 -08:00
xster
fa1b8d5821 A low scope error message height fix for #3091 (#7685)
* Print the error message multiple times to avoid overlap with status bar and add paragraph to mock_canvas
2017-01-31 11:28:52 -08:00
Ian Hickson
d7b523e004 Apply @required according to the rules, for all of material/* (#7732) 2017-01-30 20:10:53 -08:00
Ian Hickson
0400107cdf Apply @required according to the rules, for all of widgets/* (#7730) 2017-01-30 20:10:44 -08:00
Adam Barth
9119969ad2 Add SliverGrid and ScrollGrid (#7745)
This patch adds grid supports to slivers and introduces a ScrollGrid
convenience class for making the common types of scrollable grids.

This patch also deploys ScrollGrid in an example in the Flutter Gallery.
2017-01-30 17:27:51 -08:00
Adam Barth
edcab3c340 Add TabBar.unselectedLabelColor (#7747)
Our previous behavior of hard-coding the unselected label color to 70% of the
selected color was too restrictive.

Fixes #7738
2017-01-30 16:46:09 -08:00
Adam Barth
a0dee550c0 Use ScrollView in more places (#7746)
Now that ScrollView supports itemExtent, we can use it in a few more places.
2017-01-30 16:45:51 -08:00
Ian Hickson
64d3647084 Tab crash in complex_layout (#7744) 2017-01-30 16:11:01 -08:00
Adam Barth
098af18393 Add SliverList (#7727)
Add SliverList

A SliverList is a linear layout of box children in a viewport that all
have a common, fixed extent along the scroll axis. The layout is similar
to a SliverBlock but more efficient.
2017-01-30 00:40:50 -08:00
Ian Hickson
6e30cae8fa Warn about the size setter. (#7729) 2017-01-29 23:58:42 -08:00
Ian Hickson
a8ed018386 Documentation fixes (#7731)
Fixes https://github.com/flutter/flutter/issues/4620
2017-01-29 23:43:01 -08:00
Ian Hickson
e8c9797d1a Various documentation fixes. (#7726)
Fixes for: https://github.com/flutter/flutter/issues/7570 https://github.com/flutter/flutter/issues/7231 https://github.com/flutter/flutter/issues/2841 and others
2017-01-29 22:39:15 -08:00
Ian Hickson
ab28e2c46a Key improvements (#7719)
ValueKey and ObjectKey shouldn't be == with subclasses.
Fixes https://github.com/flutter/flutter/issues/3107

Clean up toString for the keys a bit.

Add a test for keys.
2017-01-28 16:29:23 -08:00
Ian Hickson
512a9af6a0 deprecate needsLayout (#7718)
The needsLayout getter is prone to misuse. See discussion on #3083.
2017-01-28 14:26:08 -08:00
Ian Hickson
571834ea3c Indicate required fields in flutter_gallery demo. (#7717) 2017-01-28 01:48:18 -08:00
Hans Muller
17389244bf Fix BorderSide rendering (#7705) 2017-01-27 15:03:20 -08:00
Adam Barth
743be6746e Split ScrollableViewport2 from Scrolllable2 (#7707)
This structure makes it easier to customize the viewport used in a Scrollable.
Now Scrollable2 doesn't commit to using slivers.
2017-01-27 13:14:41 -08:00
Adam Barth
5ecf8786b4 Add ScrollView.padding (#7690)
Uses SliverPadding to implementing paddding in ScrollView. Also, deploy
ScrollView in more places now that it implements padding.

Finally, remove loader_app.dart because it is not referenced.
2017-01-26 23:14:37 -08:00
Adam Barth
9c288040ce Improve SliverBlockDelegate.estimateScrollOffsetExtent (#7689)
We now report an accurate estimate when the lastIndex is the final index
in the list.

Also, we now project forward from the lastIndex using the extent of the
reified children instead of trying to project forward from index 0.

This new algorithm leads to estimation error as you reach the end of a
list, avoiding some ballistic overscrolls.
2017-01-26 22:59:10 -08:00
Ian Hickson
ed2be89569 Try moving from closures to direct calls. (#7679)
Rumours have it that this is faster now.

Fixes https://github.com/flutter/flutter/issues/5154
2017-01-26 18:54:48 -08:00