(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.
You can now set an offset that will be used for the hit testing for
drops. (It doesn't move the feedback by default; use a Transform for
that.) I also made the default feedback not be Opacity 0.5 always.
Introduce a Draggable class that wraps all the logic of dragging
something and dropping it on a DragTarget.
Update examples/widgets/drag_and_drop.dart accordingly.
Make the performance/transition part of routes optional.
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.
This still leaves Flex and FlexDirection available. At some point once
people have transitioned to Row/Column we should rename Flex to _Flex
and stop reexporting FlexDirection from basic.dart.
Widgets that want to receive drops should include a DropTarget in their build.
Currently there's no widget for initiating a drag. Components can use the
DragController directly. In the future, we'll probably want to add a Draggable
that knows how to do some of this work automatically.
Fixes#612