Transform applies its transform before painting, but sometimes you want
the widget to layout after its transform has been applied. We can't
handle general tranforms in this way because we can't couple width and
height constriants, but we can handle certain rotations.
Fixes#1214
Removing some special-casing in pursuit of aligning `flutter analyze` output with that provided by server/IDEs. Specifically:
* strong-hints (stale, no longer supported)
* "analyzer says" comment handling in favor of `//ignore`s
* `conflictingNamePattern` --- no longer needed
Next up some of the error filter regexps...
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.
Well, all the easy ones, anyway.
For some reason `// ignore:` isn't working for me so I've disabled
lints that need that. Also disabled those that require a ton of work
(which I'm doing, but not in this PR, to keep it reviewable).
This adds:
- avoid_init_to_null
- library_names
- package_api_docs
- package_names
- package_prefixed_library_names
- prefer_is_not_empty
- sort_constructors_first
- sort_unnamed_constructors_first
- unnecessary_getters_setters
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
This patch prepares us to pass a BuildContext to RenderObjectWidgets, which
will make it possible to rebuild RenderObjectElements:
* Delay creation of the render object until mount(). That will let us pass
`this` to createRenderObject and have the inherited elements be initialized.
* Cleanup widgets that take builder closures to prepare for their
RenderObjectElement to be rebuilt more often.
* Add a test for the interaction between inherited widgets and
MixedViewport.
Related to #2598
Since we removed our operator== overload, we can now allow people to put
these in collections again.
Also, turn on two more analyzer lints: avoid_empty_else and hash_and_equals.