Previously MaterialApp was responsible for ending the activity when the
back stack was empty. However, this behavior is more general than
material. This patch moves the behavior to FlutterWidgetBinding, which
has a global view of all the binding observers.
Fixes#1086
- make them all have the same style
- make them all include the stack trace last
- make them all stop printing if their callback is set (if
appropriate, they don't yet all have callbacks)
I think I wanted to use this at some point but ended up going a
different direction. Instead, object.dart has a private field that
serves a similar purpose.
Convert TabBar to TabBar<T> and TabBarSelection to TabBarSelection<T>
The TabBarSelection constructor no longer has the odd maxIndex parameter and the selection is initialized by value rather than the index of the selected tab.
TabBar has a Map labels parameter instead of List.
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.
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.
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.
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.
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.
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