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.
* allow mulitple observers for Navigator and MaterialApp
* add test for the navigator observers
* fix style
* add test for adding/removing a navigator observer
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.)
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.
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.
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.
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.
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.
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.
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.
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.