This converts existing ## Sample code samples to {@tool sample}...{@end-tool} form.
Also:
1. Fixed a minor bug in analyze-sample-code.dart
2. Made the snippet tool only insert descriptions if the description is non-empty.
3. Moved the Card diagram to before the code sample.
Should fix#22226.
Code introduced in #20890 caused a regression that broke color flooding animations in a BottomNavigationBar that has BottomNavigationBarType.shifting.
The original issue (#19653) dealt with background color changes not occurring until another tab was selected. The result is that the background color instantly changes whenever the state changes and when the widget changes, instead of allowing a new widget to animate the background color change.
This rewrites the sample code analysis script to be a little less of a hack (but still not pretty), and to handle snippets as well.
It also changes the semantics of how sample code is handled: the namespace for the sample code is now limited to the file that it appears in, so some additional "Examples can assume:" blocks were added. The upside of this is that there will be far fewer name collisions.
I fixed the output too: no longer will you get 4000 lines of numbered output with the error at the top and have to grep for the actual problem. It gives the filename and line number of the original location of the code (in the comment in the tree), and prints out the source code on the line that caused the problem along with the error.
For snippets, it prints out the location of the start of the snippet and the source code line that causes the problem. It can't print out the original line, because snippets get formatted when they are written, so the line might not be in the same place.
`RenderEditable.paint` assumes that if the length of the text fits within the
visible region, then the text will be rendered at the start of the region and be
completely visible. This is not always true, since the text may still be
rendered at an offset if an animation is ongoing when the text begins to fit.
This fixes#22288 and #14121
Re-landing #23412 with a fix to the PlatformLayer's addToScene signature.
#23412 was broken by the change to Layer done in #23434.
It seemed green as the presubmits were done before #23434 was landed, and when #23412 landed it broke the build.
Reverts #23779
This PR adds the full framework stack (layer->render object->widget, and
service) for embedding iOS views with minimal functionality.
I allowed myself to throw the entire framework stack in one PR since we're mostly
mirroring the structure we already established for embedded Android views, so this PR
is a little bigger than usual. I'm happy to break it down to the
different pieces of the stack if reviewers prefer.
Specifically this PR adds:
* A UiKitView widget for embedding a UIView in the widget tree.
* A RenderUiKitView which is the render object for showing a
UIView.
* A PlatformViewLayer which denotes the position of a UIView in the
layer tree.
* The iOS platform_views system channel client code in services/platform_views.dart
* Splits the fake platform views controller to an Android and iOS
controllers.
TBD in following PRs:
* Plumb the layout direction all the way to the platform view (currently
there is still no engine support for it).
* Integrate with gesture arenas (engine support is still missing as
well).
Luckily this class didn't actually need to extend its superclass, it
only implements the interface. So we can change `extends` to
`implements` and that's close enough, while allowing the class to be
mixed in again.
* Avoid abbreviations
* Sample code for AppBar.leading
* Add a test for OverflowBox/FractionallySizedBox
* Minor wording improvements in the text.
The words "note that" here don't really contribute to the flow.
Bug #1: These didn't work with directional alignments, due to an error
in the types of the constructor arguments.
Bug #2: Pretty sure RenderSizedOverflowBox never worked at all. As
soon as I wrote a test for it, the test showed that there was a
fundamental bug in its performLayout method: it didn't set
parentUsesSize, but it immediately tried to use the child's size.
* Improve documentation
* Potential performance win in hit testing
Rather than copying the list every time we access `path`, this just
exposes it as an `Iterable`. People who want to copy it can use
`toList()`.
(This isn't a breaking change since code that expects a `List` is
still going to get one.)
* Enforce the Oxford Comma.