(These are changes cherry-picked from in-flight branches since they are
more independent and could be helpful even without those changes.)
- Change RouteBuilder's signature to take a single argument in which the
other fields are placed, so that we can keep iterating on those
arguments without having to break compatibility each time. Also, this
makes defining route builders much simpler (only one argument to
ignore rather than a variable number).
- Expose the next performance to RouteBuilders, since sometimes the
route itself might not be where it's used.
- Allow BuildContext to be used to walk children, just like it can for
ancestors
- Allow BuildContext to be used to get the Widget of the current
BuildContext
- Allow StatefulComponentElement to be referenced with a type
specialisation so that you don't have to cast when you know what the
type you're dealing with actually is.
This patch converts drawer to using the "openDialog" pattern for managing its
state. Currently, the drawer entrance and exit animation aren't integrated with
the navigator's animation system because the drawer's animations can be stopped
and reversed, which the navigator can't yet understand. That means dismissing
the drawer via the system back button causes the drawer to be removed
instanteously.
Fixes#715Fixes#1187
Also, introduce Colors and Typography to hold the material colors and the
typography declarations. Previously we expected clients of these libraries to
import them into a namespace, but that doesn't play nice with re-exporting them
from material.dart.
Move the animation libraries into src/animation and change importers to use
package:sky/animation.dart. Also, move scheduler.dart into the animation
library so that the animation library can be self-contained.
Add a way of having keys based on numeric types or DateTimes by having a ValueKey<T> class.
Remove the redundant ways of declaring things, except for leaving one shorthand -- you can say `new Key(s)` instead of `new ValueKey<String>(s)`.
Adds itemsWrap:bool (default false) to ScrollableList and PageableList. If itemsWrap is true then scrolling past the last item wraps around to the first. Similarly, scrolling before the first item wraps around to the last.
Added abstract ExtentScrollBehavior of ScrollBehavior. Renamed fields called contentsExtents to contentExtent, containerExtents to containerExtent, contentSize to contentExtent, etc.
BoundedBehavior is now a subclass of ExtentScrollBehavior.
Added UnboundedBehavior subclass of ExtentScrollBehvaior; contentExtent and maxScrollOffset are double.INFINITY, minScrollExtent is double.NEGATIVE_INFINITY.
Changed the pageable_list.dart example: tapping on the toolbar changes
the scroll direction. This exposed some problems:
- Scrollable.syncFields() didn't update scrollDirection
- Viewport updated its RenderObject fields in the wrong order
- FixedHeightScrollable scrollDirection changes didn't update the scrollBehavior
There may be similar problems with VariableHeightList and ScrollableViewport.
I will fix those in a separate CL.