This change adds a way to provide explicit focus order for a part of the widget tree.
It adds FocusTraversalPolicyGroup, which in many ways is similar to DefaultFocusTraversal, except that it groups a widget subtree together so that those nodes are traversed as a group. DefaultFocusTraversal doesn't work as one would expect: If there is more than one DefaultFocusTraversal inside of a focus scope, the policy can change depending on which node was asked to move "next", which can cause unexpected behavior. The new grouping mechanism doesn't have that problem. I deprecate DefaultFocusTraversal in this PR.
It also adds OrderedFocusTraversalPolicy, which is a policy that can be supplied to FocusTraversalPolicyGroup to set the policy for a sub-tree. It looks for FocusTraversalOrder inherited widgets, which use a FocusOrder to do the sorting. FocusOrder has two subclasses: NumericalFocusOrder (which sorts based on a double), and LexicalFocusOrder, which sorts based on a String.
As part of doing this, I refactored the way FocusTraversalPolicy is implemented so that it has more default implementation methods, and exposes a new protected member: sortDescendants, which makes it easier for developers to make their own policy subclasses: they only need to implement sortDescendants to get a new ordering behavior, but can also still override any of the default implementation behaviors if they need different behavior.
I was able to do this without breaking the API (AFAICT).
This PR modifies the existing API docs samples to use DartPad so that all of the samples are now interactive apps on the API docs site.
It also removes the restriction for the max width of the description area so that the dartpad region can expand horizontally.
I updated the first paragraph on the API docs to indicate that Flutter is more than just mobile now (same text as the README.md at the top level).
I modified a few of the examples so that they looked nicer, and fit better on the page.
I added the sample description text above each DartPad instance, since that often defines the context of the example.
I removed animations and images when they were redundant with the sample content. There were a few that made sense to keep, so I did.
* c9322145f Ensure fields of Rect and OffsetBase classes are optimized as non-null. (flutter/engine#16465)
* 5c70356a9 Simplify task queues locking mechanism (flutter/engine#16477)
* d589ddea6 Fix text range logic for a11y (flutter/engine#16496)
* 1a4f4e394 Fix unused import in Android embedder (flutter/engine#16494)
* 964ae1009 Disable ShellTest.WaitForFirstFrameTimeout on Fuchsia (flutter/engine#16495)
* 6158f03ef Roll src/third_party/skia 87e3bef6f82f..9f3eef796f63 (7 commits) (flutter/engine#16493)
The current implementation of DropdownButtonFormField does not pass the initial value to _DropdownButtonFormFieldState. As a result changes made through the child DropdownButton are not made to the FormFieldState and the widget is not updated unless a onChanged function is provided to the DropdownButtomFormField constructor.
This change modifies DropdownButtonFormField to behave more consistently with other FormField widgets in how the Form state is handled.
* d5442b86e Roll src/third_party/skia bc3307c395e2..ebc00f97fab1 (21 commits) (flutter/engine#16429)
* 76b291a65 Added a plugin method that gets called when the engine is about to be deleted (flutter/engine#16336)
* 07f25c51e fix bad reference to maxDiffRatePercent (flutter/engine#16440)
* 41d50c220 Reland #16206: "[web] Correct getPositionForOffset for multi-line paragraphs" (flutter/engine#16365)
* f25d325b1 [fuchsia] change kMaxFramesInFlight to 3 (flutter/engine#16425)
* 473f55940 Suppress some deprecation warnings on Windows (flutter/engine#16416)
* 2e34ad6b7 Roll fuchsia/sdk/core/mac-amd64 from ubThi... to fvWgE... (flutter/engine#16454)
* 47c02e6fc Roll src/third_party/skia ebc00f97fab1..cbf79b95c2d4 (4 commits) (flutter/engine#16456)
* 3d1b112d7 Roll buildroot (flutter/engine#16419)
* 28e663726 Add explicit casts to printing of function pointers (flutter/engine#16370)
* 9ad81dae1 Wrap strdup to use compliant name on Windows (flutter/engine#16372)
* 9708e5274 Roll rapidjson (flutter/engine#16347)
* f06ebba3e Include <memory> in hb_wrapper.h because unique_ptr is used. (flutter/engine#16442)
* e530376fb Roll fuchsia/sdk/core/linux-amd64 from VJv0H... to A9STP... (flutter/engine#16457)
* 4cc41ae97 Roll src/third_party/skia cbf79b95c2d4..4721e067812f (1 commits) (flutter/engine#16459)
* 2f233edf5 Roll src/third_party/skia 4721e067812f..f6e3eaf05150 (1 commits) (flutter/engine#16461)
* b0b0ed83b Roll src/third_party/skia f6e3eaf05150..cc21d0c1f2ce (1 commits) (flutter/engine#16463)
* 7fea936a0 Roll src/third_party/skia cc21d0c1f2ce..116b33e8ab21 (3 commits) (flutter/engine#16466)
* 001b3a0b1 Roll src/third_party/skia 116b33e8ab21..7f36405ea3ec (3 commits) (flutter/engine#16471)
* f3ce90e93 Reset width/height before deallocation for Safari allocation bug. (flutter/engine#16469)