This implements VisualDensity changes for text fields*. By default, the layout of the text field does not change.
If the ThemeData.visualDensity is set to a value other than zero, then the density of the UI will increase or decrease. See the VisualDensity docs for more information.
(*In reality, the changes are on the InputDecorator class, not on the text field.)
I also fixed a problem that I think I found with _Decoration where it doesn't compare isDense or isCollapsed as part of its operator==.
Fixes#51010
The test package differentiates between passing and not passing this
argument. A previous version had a bug that treated passing `0`
identically to not passing the argument, and the flutter test runner
relied on this bug by always passing a value and using a default of `0`.
- Remove the argument defaults throughout to make it clear that `null`
is a valid value and the default.
- Remove the argument defaulting on the argument parser.
- Update the wording of the usage for this argument, this will also be
updated on the `package:test` side.
This fixes a problem where if you press "Shift" and then "A", then release "Shift" and then "a", then the "A" key will be "stuck" on because the logical key for the key down message is different (capital "A") from the logical key for the key up message (lowercase "a").
This PR changes the pressed keys logic so that it uses the physical key to add/remove keys from the list of pressed keys, but keeps the associated logical key.
This does mean that after the "Shift" key goes up, the pressed keys contains a capital "A" and it doesn't switch to be a lowercase "a", but there isn't currently any mechanism we can use to do that remapping. This is far less surprising than the current behavior, but is still not quite correct.
I fixed the event simulation code to take a physicalKey so that it could be matched with the logical key, but the event simulation code isn't up to the task, since it can only simulate keys that appear in the key maps. The new platform key event design should fix that (added TODOs).
The next engine roll will introduce --lazy-async-stacks, which affects the
contents of stack traces. This updates test expectations to match both the
old and new stack trace formats.
With --lazy-async-stacks the stack output has changed slightly so updating the expect files to match.
This is a follow-up to https://github.com/flutter/flutter/pull/51047 as a preparation for the next engine roll which will start enabling --lazy-async-stacks in JIT mode.
* [Web] Add Material Card Infinite Scroll benchmark
Adds a benchmark that makes an infinite list of Material cards
and scrolls it. This benchmark exercises more heavyweight rendering
like shadows and clipping and paths.
* Fix analyzer warnings. Respond to comments
This re-lands #49235 with the addition of includeSemantics flag on the Focus widget so that the FocusTraversalGroup can create a Focus widget without affecting the semantics tree.
The FocusTraversalGroup uses the Focus widget to create a grouping of descendants for traversal, but doesn't actually participate in focus (canRequestFocus is always false), so we don't want it to add a Semantics widget in that case, since that can cause semantics changes. The canRequestFocus attribute can also be used when a widget is disabled, so we do sometimes want to include Semantics even if that is false, but not in the case where it is always false, as for FocusTraversalGroup.
- Added a test to make sure that FocusTraversalGroup doesn't add any semantics information.
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).