http://www.google.com/design/spec/components/chips.html#chips-behavior
This patch adds support for deletable and non-deleteable chips, but doesn't yet
add support for contact chips. Also, demo the chips in a new Material Gallery
app that will let us demo our gallery of widgets in a single app.
- Removed the concept of ephemeral routes.
- Renamed the two _MenuRoutes to _PopupMenuRoute and _DropDownRoute.
- Added type arguments in various places:
- DropDownMenu
- _DropDownRoute
- _ModalBottomSheetRoute
- PopupMenuItem
- _PopupMenu
- _PopupMenuRoute
- Made _ModalBottomSheetRoute, the two ex _MenuRoutes, and _DialogRoute
all inherit from ModalRoute, via PopupRoute.
- Change "Dropdown" and "DropDown" to "DropDown" consistently.
- Made MaterialPageRoute inherit from PageRoute.
- Made ModalBarrier not create a box if it's always transparent.
- Exposed the Futures on TransitionRoutes.
- Fixed that menus were no longer dismissable by tapping the modal
barrier.
- `Scaffold.of(context).showBottomSheet(widget);`
- Returns an object with .closed Future and .close() method.
- Uses a StateRoute to handle back button.
- Take the Navigator logic out of the BottomSheet widget.
- Support showing a sheet while an old one is going away.
- Add Navigator.remove().
Many of the widgets that use CustomPaint were spamming repaints because
CustomPaint repaints when the identity of the onPaint callback changes, which
it does every build for StatelessComponents.
This patch changes CustomPaint to use a CustomPainter, similar to the new
custom layout widgets. The CustomPainter has a `shouldRepaint` function along
with its `paint` function. This function gives clients explicit control over
when the custom paint object repaints.
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.
"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.
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.
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.
Other changes in this patch:
- Make the 'flutter' tool say "Updating flutter tool..." when it calls
pub get, to avoid confusion about what the pub get output is about.
- Make the bash flutter tool call pub get when the revision has
changed. (This was already happening on Windows.)
- Fix a raft of bugs found by the analyzer.
- Fix some style nits in various bits of code that happened to be near
things the analyzer noticed.
- Remove the logic in "flutter test" that would run "pub get", since
upon further reflexion it was determined it didn't work anyway.
We'll probably have to add better diagnostics here and say to run the
updater script.
- Remove the native velocity tracker script, since it was testing code
that has since been removed.
Notes on ignored warnings:
- We ignore warnings in any packages that are not in the Flutter repo or
in the author's current directory.
- We ignore various irrelevant Strong Mode warnings. We still enable
strong mode because even though it's not really relevant to our needs,
it does (more or less accidentally) catch a few things that are
helpful to us.
- We allow CONSTANTS_LIKE_THIS, since we get some of those from other
platforms that we are copying for sanity and consistency.
- We allow one-member abstract classes since we have a number of them
where it's perfectly reasonable.
- We unfortunately still ignore warnings in mojom.dart autogenerated
files. We should really fix those but that's a separate patch.
- We verify the actual source file when we see the 'Name non-constant
identifiers using lowerCamelCase.' lint, to allow one-letter variables
that use capital letters (e.g. for physics expressions) and to allow
multiple-underscore variable names.
- We ignore all errors on lines that contain the following magic
incantation and a "#" character:
// analyzer doesn't like constructor tear-offs
- For all remaining errors, if the line contains a comment of the form
// analyzer says "..."
...then we ignore any errors that have that "..." string in them.
Factored OverlayRoute out of the modal and persistent bottom sheet clases, since the bottom sheet classes need to drive the performance.
Added a bottom sheet to the stocks demo: long-press on a stock shows a modal bottom sheet.
Made AnimatedModalBarrier public.
It's common to want a scrolling viewport but with padding around the
contents. Teaching Block about this makes the places that do this
substantially simpler and further buries ScrollableViewport and
BlockBody (they're now only used in scrollable.dart).
Draggable is now itself a gesture arena member. This means it won't
conflict with other gesture recognisers in the same path.
This also allows variants of Draggable that are triggered by other
gestures.
Also, some cleanup of DoubleTapGestureRecognizer, GestureDetector, and
PrimaryPointerGestureRecognizer.
Also, make MultiTapGestureRecognizer support a timeout for longpress.
Also, make Draggable data be typed.
Also, hide warnings about constructor warnings for now. Analyzer doesn't
support them yet. (Have to do this on a per-line basis)
Directions for future research:
- animating the avatar (enter/exit transitions)
- interaction with the navigator (canceling a drag on page navigation, etc)
- double-tap draggable
This patch introduces the notion of a ModalRoute that puts up a modal barrier
and makes the route invisible to hit testing when its animating out. This patch
also uses this mechanism in a number of places (including PageRoute). There are
still a few more cases to convert, but that's work for a future patch.
Fixes#1684
This patch combines embedder.dart and shell.dart into one thing. We should now
handle a bunch of error cases better.
* embedder.connectToApplication has moved to shell.connectToApplication,
matching the rest of the mojo universe.
* embedder.connecttoService has moved to shell.connnectToService (and merged
with shell.requestService).
* shell.requestService is now shell.connectToService, matching the rest of
the mojo universe.
* serviceRegistry has moved from embedder.serviceRegistry to a top-level
getter.
Fixes#1803
MixedViewport didn't use the building:true flag when locking itself, so
when it caused a rebuild of its children, we assumed that nobody was
allowed to mark things dirty below the list, and things crashed when
Inherited people did in fact rebuild.
Also:
- default offset for MixedViewport
- don't bother rebuilding if the underlying RenderObject is going to
rebuild anyway for some reason
- better docs for the "items must have keys" assert
- keep the FlipComponent stuff together in test_widgets.dart
Material design icons are defined to work at specific sizes: 18, 24, 36, 48.
The current API doesn't reflect that and just takes a size int. If an invalid
size is chosen an error is printed to the console and no icon shows up.
Fixes#1816
- Change RouteArguments to pass the route's BuildContext rather than
the Navigator. This caused the bulk of the examples/ and .../test/
changes (those are mostly mechanical changes). It also meant I could
simplify Navigator.of().
- Make initState() actually get called when the State's Element is in
the tree, so you can use Foo.of() functions there. Added a test for
this also.
- Provide a RouteWidget so that routes have a position in the Widget
tree. The bulk of the route logic is still in a longer-lived Route
object for now.
- Make Route.setState() only rebuild the actual route, not the whole
navigator.
- Provided a Route.of().
- Provided a Route.writeState / Route.readState API that tries to
identify the clients by their runtimeType, their key, and their
ancestors keys, up to the nearest ancestor with a GlobalKey.
- Made scrollables hook into this API to track state. Added a test to
make sure this works.
- Fix the debug output of GestureDetector and the hashCode of
MixedViewport.
- Fixed ScrollableWidgetListState<T> to handle infinite lists.
Previous these callbacks were leaking the implementation detail that they were
triggered by taps. In a later patch, we're going to add a parameter to
GestureTapCallback that these callbacks won't have.
Related to #1807
Instread of an explicit 'enabled' bool, this uses the presence of the
event handler to determine if a widget is enabled or not. This means
that if you've not passed a handler, your widget will be disabled, which
makes sense, since it wouldn't work anyway.
Adds this feature to checkbox, and ports raised button, flat button, and
radio buttons to this new model.
Adds a checkbox to card_collection that can be disabled.
Hide a (basically bogus) hint from the (soon to be disabled) strong hint
mode in the analyzer that this reveals.
Also:
- give card_collection an option to turn on or off the edit widgets
- give card_collection an option to control text alignment (when not editing)
- give card_collection a "dump" option to aid debugging
- make the gesture detector report which gestures it is listening to
If you load the example and immediately switch to the Portfolio tab, you may
see exceptions due to symbols that are in the portfolio list but whose
data is not yet present in the stocks map
Make Radio widgets take a type that describes the type of their value,
so that you can catch when you use the wrong value.
Standardise on ValueChanged<Foo> instead of having a FooValueChanged
for every value of Foo.
Adds a step to the updater to verify that the new .flx package is signed and
untampered.
Each .flx contains a signed manifest file. The manifest contains a SHA-256 hash
of the .flx contents. See bundle.dart for a description of the new .flx format.
Teach dumpRenderTree() to draw actual trees.
Make the TextStyle output terser so it doesn't overflow the output.
Make debugDumpApp() say what mode we're in (checked vs release).
Hide lifecycle state from release mode dumps (since it's checked-only state).
Enabled displaying a scrollbar in ScrollingLists. The scrollbar is painted as an "overlay", i.e. it's painted on top of the scrolling list's visible children.
Added an abstract Painter base class that encapsulates a paint method and the renderer that it's attached to. RenderBlockViewport and HomogenousViewport now support an overlayPainter property. If specified, RenderBlockViewport attaches itself to the overlayPainter when it's attached to the rendering tree. RenderBlockViewport now calls overlayPainter.paint() after it has painted its children.
Added an abstract ScrollingListPainter class that exposes ScrollingList's state which might be needed for painting. Like its scroll direction and scrollOffset. The ScrollingListPainter is notified when a scroll starts and ends.
Defined a Material-specific ScrollingListPainter that renders a scrollbar. The scrollbar thumb is faded in/out when the scroll starts/ends.
Added onScrollStart and onScrollEnd listeners to Scrollable.
Also, fix warnings in rendering/sector_layout.dart
Also, fix hit testing in rendering/sector_layout.dart
Also, add WidgetToRenderBoxAdapter
Also, make the rendering library debugging tools more resilient to
dumping stuff before layout is complete.
Add type annotations in many places.
Fix some identifiers to have more lint-satisfying names.
Make all operator==s consistent in style.
Reorder some functions for consistency.
Make ParentData no longer dynamic, and fix all the code around that.
Added horizontal and vertical alignment properties to Stack so that the origin of non-positioned children can be specified. Currently all of the non-positioned children just end up with their top-left at 0,0. Now, for example, you can center the children by specifying verticalAlignment: 0.5, horizontalAlignment: 0.5.
Added IndexedStack which only paints the stack child specified by the index property. Since it's a Stack, it's as big as the biggest non-positioned child. This component will be essential for building mobile drop down menus.
Added a (likely temporary) example that demonstrates IndexedStack.
Previously, RenderObjectElements didn't support being marked dirty. This
is fine, except for MixedViewport and HomogeneousViewport, which have
builder functions to which they hand themselves as a BuildContext. If
those builder functions call, e.g., Theme.of(), then when the theme
changes, the Inherited logic tries to tell the RenderObjectElement
object that its dependencies changed and that doesn't go down well.
This patch fixes this by making RenderObjectElement a BuildableElement,
and making MixedViewport and HomogeneousViewport hook into that to
rebuild themselves appropriately.
Also, this was only found at all because ThemeData didn't implement
operator==, so we were aggressively marking the entire tree dirty all
the time. That's fixed here too.
Also, I changed card_collection.dart to have more features to make this
easier to test. This found bugs #1524, #1522, #1528, #1529, #1530, #1531.
The margins make using showMenu's menuPosition argument difficult and they're not really needed.
I also made a few small gratuitous changes in navigator.dart.
This patch makes the level of the ToolBar configurable. I've also cleaned up
the Tab code slightly.
For some reason, there's still a hairline between the ToolBar and the TabBar.
We might need to rethink how we draw the background a bit here.
Fixes#1454
Focus.at() and company should be on Focus, not FocusState.
_notifyDescendants() was using the wrong runtimeType.
Let InheritedWidget update the descendants during build.
When you setState() during build, assert that you're not
markNeedsBuild()ing someone who isn't a descendant.
Typo in Widget.toString().
(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 simplifies AnimationTiming and all the AnimatedValue base classes.
Also, make PopupMenu a stateless component because it has no state.
Fixes#1168
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
After this patch, InkWell is driven by gesture recognizers, which lets us
cleanly cancel splashes when the user actually scrolls.
I've also refactored all the clients of InkWell to use InkWell to detect
gestures instead of wrapping InkWell in a GestureDetector.
Fixes#1271
The ShaderMask widget enables rendering its child with an alpha channel defined by a Shader. For example if the Shader was a linear gradient in alpha then the component behind the ShaderMask's child would appear wherever the gradient's alpha value was not fully opaque.
The card_collection.dart example demonstrates this. Select the "Let the sun shine" checkbox in the app's drawer.
Identify specific parts of a Stock row with a Global Key that can be
regenerated later, and pass that key back to event handlers so they can
use them to do the transition.
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.