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