...by adding tests to our examples that don't import flutter_test, which
pins the relevant dependencies.
Also, provide more information when complaining about leaked transient
callbacks in tests.
Also, make tests display full information when they have an exception,
by bypassing the throttling we have for Android logging in tests.
Also, make the word wrapping not wrap stack traces if they happen to
be included in exception output.
Also, fix a leaked transient callback in the checkbox code.
I ran into a case where I was setting minHeight=∞ and then calling
layout() with that constraint, which is all kinds of bad. To try to
catch this earlier, this patch now provides a way to catch constraints
that are requiring infinite values.
We don't _always_ check this because there are valid uses for
BoxConstraints.biggest, e.g. as an additionalConstraint.
* Added Scrollbar, removed ScrollbarPainter
* removed a dead import
* updated per review feedback
* Only call dispatch if the widgets State is still mounted
Fix some legit uses of GlobalKey to specify the type they want.
Fix some sketchy uses of GlobalKey in tests to fake it with "as
dynamic".
Remove some extraneous imports that made the build red.
Previously, the client of PopupMenuButton needed to build all the menu times
when building the PopupMenuButton. This can get expensive if, for example, each
item in a scrollable list has a popup menu associated with it.
Now the client passes a builder function to the PopupMenuButton that gets
invoked only when its time to show the menu items.
Using .of() to call mutating setters is not great practice since it ties
parts of the app together in ways that prevent reuse and composition.
Since people are now using the gallery app to copy from, let's use the
better practice of using callbacks.
Adds BuildOwner to manage the dirty list and build processing for
widgets/elements, and adds a widget unit test to make sure separation
is enforced.
Fixes#2723
The collections package changed to add some stricter type annotations.
We now pass those type annoations. I also sent
https://github.com/dart-lang/collection/pull/26 to make the type
annotations match what they were previously.
Previously, border with '0' was ambiguous. Sometimes we treated it as
hairline borders, sometimes as "don't show the border", though even in
the latter case we did some graphics work sometimes. Now we have an
explicit BorderStyle.none flag to not draw the border efficiently.
Also misc cleanup:
- reorder members to be more consistent and fit the style guide
- remove use of _Pair
- made Variable.applyUpdate and Variable.owner public
- added docs to Priority, tweaked the code a bit
- added some docs to Result
- removed the internal-error Result (replaced with asserts)
- removed unused Results
- made Result const
- merged some files together since they had used privates a lot
I'm sorry this is completely unreviewable. I did the move from `lib/*`
to `lib/src/*` first, then did the `part`-to-`import` change, and then
found out how many of the files involved privates, which I wasn't
expecting. I can redo this as multiple commits if that would make it
easier to review.
* left -> leading (Removes an LTR bias)
* center -> title (Widget was actually centered)
* right -> actions (Removes an LTR bias, asymmetric with leading)
Fixes#2348
The terms "left" and "right" have an LTR bias. Instead, we now use
"leading" and "trailing", for these list and grid decorations so that
we can later rearrange them to match the reading order.
Fixes#2540Fixes#2548
We'll need this for RTL support because the RTL state will live in the widget
tree. Also, remove the `oldWidget` argument to updateRenderObject because there
aren't any clients for it.
Specifically:
* Handle null styles in TextSpan without crashing in toString().
* Handle null children in TextSpan child lists without crashing in
toString().
* Handle entirely empty TextSpans in toString() explicitly.
* Assert that TextSpans don't contain nulls in various places. This is
done more often than one might think necessary, because it turns out
that TextSpan takes a (mutable) List for one of its arguments, so
who knows what it will contain at any given time. By asserting all
over the place, hopefully we'll catch it near the change if they do
change it.
* Add a RichText example to Stocks to exercise RichText and TextSpans.
See also: https://github.com/flutter/flutter/issues/2514, https://github.com/flutter/flutter/issues/2519
After running a widget test, we now clear out the widget tree and check that we
didn't leak any timers or animations.
Also, fix several bugs that this addtional check revealed.
Fixes#2481
Most of the remaining widget examples are actually manual tests. This patch
moves them into //dev/manual_tests. A couple are examples of using services,
which I've moved to //examples/layers/services. The remainder are out-dated and
are removed by this patch.
This enum doesn't make sense anymore now that we can arbitrarily colorize
icons. Instead, we just use a Color, which is both simpler and can be
interpolated during animations.
Fixes#1279
Rather than managing all the Material Design icons manually, we now
manage them using an icon font. The icon font contains glyphs for each
icon in an efficient vector format.
This patch updates the FLX tooling to include the MaterialIcons font and
updates the Icon widget to use the font instead of asset images.
Fixes#2313Fixes#2218Fixes#2009Fixes#994
We originally wrote examples/fitness to be an app which all
members of the Flutter team could carry on their phones and
use every day. It served us well for testing of Text input,
Keyboards and writing/reading JSON. It's never actually become
a real carry app, so lets just let it go for now.
@abarth @collinjackson
Now we just have one TextSpan class that handles both simple strings, trees of
children, and styling both. This approach simplifies the interface for most
clients.
This patch also removes StyledText, which was weakly typed and tricky to use
correctly. The replacement is RichText, which is strongly typed and uses
TextSpan.
In the dark theme, there isn't really a primary swatch, so this API was
a sandtrap. Instead, be explicit about the colors we need for various
widgets in the theme.
Fixes#1277
This patch makes it easier to use the auto layout API:
* We no longer use operator== because that requires an ugly cast by the
API user.
* Also, "leftEdge" is now just "left" for less verbosity.
* AutoLayoutChild not implies its key from the AutoLayoutParam object.
* We now correctly layout every child of a RenderAutoLayout object even
if the solver doesn't flush any updates to that child.
This patch teaches the widget framework how to use Cassowary-based
autolayout. To integrate autolayout with widgets, I had to refactor how
RenderAutoLayout worked a bit. Now RenderAutoLayout follows the same
delegate pattern we use for custom paint and custom layout.