This pattern breaks when using compositing because we need to lift those
operations into the compositing tree. This patch removes all the ones I could
find and adds an assert to help prevent more from getting introduced.
Fixes#191
This patch simplifies PaintingContext with several goals:
1) We now call a callback instead of assuming the caller has a single child to
paint. This change will let us handle render objects that wish to paint more
than one child.
2) We now avoid creating lots of empty picture layers because we don't eagerly
start recording pictures. Instead, we wait for the first caller to touch the
canvas before creating the picture recorder.
3) We now are more consistent about which values have incorporated the painting
offset.
Previously, we were putting a ForcedLayer just below the overlay, but that
causes trouble for routes like the popup menu that want to position themselves
inside the overlay. Instead, I've moved the ForcedLayer down into ModalRoute.
Also, rename ForcedLayer to RepaintBoundary, which is more descriptive of what
this widget does.
Fixes#485
"showSnackBar()" is now a feature of a Scaffold. To get to a Scaffold
you either use a global key (`scaffoldKey.currentState.showSnackBar(...)`),
or you use `Scaffold.of(context)`.
Snack bars no longer have a route. They are entirely managed by the
Scaffold. Fixes#432.
Snack bars now queue up when you have several of them. Fixes#374.
Snack bars now auto-size themselves around their contents. This is step
one towards implementing multiline snack bars.
Snack bars now self-dismiss after some per-snackbar configurable period.
The self-dismissing pauses while a dialog is up above the snackbar (or
anything that uses ModalRoute). To enable this, there's now a
`ModalRoute.of(context)` API that returns the current ModalRoute, and
you will be rebuilt if you asked for this and the route's "current"
status changes. To implement this, the Navigator now rebuilds
unconditionally any time it pushes or pops a route.
Snack bars now use the curves that Android uses for snack bars.
Snack bar contents now fade in.
Now we use a forced layer around the reprojected content of the drawer, which
means we don't have to re-record it during the slide animation. This saves 2ms
per frame.
The total main-thread time for the drawer animation is now 2.0ms.
Now we use a ForcedLayer in the navigator overlay to cache the recording for
each entry in the overlay. This mechanism just caches the display list, not the
underlying pixels.
Also, remove the "dispose" notification in the Layer tree because it was
disposing layer too eagerly. We don't actually need this notification for
anything other than eagerly freeing some C++ memory.
Shadows now render as three seprate MaskFilter.blur components per the most recent Material spec.
The shadows Map was replaced by a similar Map called elevationToShadow with entries that match the 10 elevations specifed by http://www.google.com/design/spec/what-is-material/elevation-shadows.html.
The "level" property (many classes) is now called "elevation", to match the Material spec.
BoxShadow now includes a spreadRadius parameter - as in CSS box-shadow. Renamed the BoxShadow blur property to blurRadius to further align BoxShadow with CSS box-shadow.
Turns out we were assuming that once the global key is gone, our
listener is unregistered. It isn't.
I'm planning on adding a test as part of my nested navigator work.
A common pattern is to use a Positioned with a Sized box to give both an offset
from the edge as well as a fixed size to the child. This patch rolls into into
the Stack layout algorithm for simplicity.
Fixes#250
- drag and drop was using the wrong draggables (long press vs short
press).
- navigation.dart wasn't using material correctly and so was ending up
with some red text.
- piano wasn't followig our style guide even a little.
- date picker was not scrollable.
PageRoute is now MaterialPageRoute.
This also changes the following:
- Now the HeroController is a Navigator observer, rather than a feature
of HeroPageRoutes, which are gone. This means heroes can work between
any kind of ModalRoute now.
- ModalPageRoute is moved from modal_barrier.dart to routes.dart.
- It allows routes to opt-out of their modal barrier being a shortcut to
popping the route.
- Features of PageRoute that aren't Material-specific get promoted to
ModalRoute features: storage, the subtree key, offstageness...
The AnimatedModalBarrier is still a ModalRoute feature.
Safely clear SnackBack and BottomSheet placeholders
Correct one stocks demo bug: displaying the stock symbol viewer (single tap on a row) while a BottomSheet or SnackBar was up, would assert.
Thep SnackBack and BottomSheet placeholder keys are cleared when they're obscured by a route with an opaque OverlayEntry. So in that case there's no need to try and clear the placeholder's child again.
Prior to this patch, MultiChildLayoutDelegate couldn't be re-entered because it
cleared _idToChild when unwinding its stack. Now we restore the previous value
of _idToChild when we unwind.
Now we use a zero-width space to force the engine to resolve the font and tell
us how large the text is likely to be once there's text in the widget.
Fixes#302
Make sure to send tapcancel when the primary pointer fails because of
slop, even if the gesture won by default.
Also, minor cleanup and clarification of an invariant.