7226 Commits

Author SHA1 Message Date
Greg Spencer
d4226566d4
Change Focus.unfocus to take a disposition for where the focus… (#50831)
When Focus.unfocus is called, the caller usually just thinks about wanting to remove focus from the node, but really, unfocus is a request to automatically pass the focus to another (hopefully useful) node.

This PR removes the focusPrevious flag from unfocus, and replaces it with a disposition enum that indicates where the focus should go from here.

The other value of the UnfocusDisposition enum is UnfocusDisposition.scope.

UnfocusDisposition.previouslyFocusedChild is closest to what focusPrevious used to do: focus the nearest enclosing scope and use its focusedChild field to walk down the tree, finding the leaf focusedChild. This PR modifies it slightly so that it walks up to the nearest focusable enclosing scope before trying to focus the children. This change addresses #48903

A new mode: UnfocusDisposition.scope will focus the nearest focusable enclosing scope of this node without trying to use the FocusScopeNode.focusedChild value to descend to the leaf focused child. This is useful as a default for both text field finalization and for what happens when canRequestFocus is set to false. It allows the scope to stay focused so that nextFocus/previousFocus still work as expected, but removes the focus from primary focus.

In addition to those changes, unfocus called on a FocuScope that wasn't the primary focus used to unfocus the primary focus instead. I removed that behavior, since it was buggy: if the primary focus was inside of a child scope, and you called unfocus on the parent scope, then the child scope could have focused another of its children instead, leaving the scope that you called unfocus on with hasFocus returning true still. If you want to remove the focus from the primary focus instead of the scope, that's easy enough to do: just call primaryFocus.unfocus().

Fixes #48903
2020-02-26 18:04:32 -08:00
Dan Field
444b13b895
Colored box and container optimization (#50979) 2020-02-26 16:04:35 -08:00
Dan Field
c75db98337
Live image cache (#51485)
* Reland "Live image cache" (#51441)

This reverts commit 419a2853a8e4ac846524afeb49b866d4cdaa7d9d.

* Make evict safer
2020-02-26 16:01:56 -08:00
Ferhat
1a79592b4a
Reduce closure allocation in RenderObject.cleanRelayoutBoundary (#51439) 2020-02-26 15:53:19 -08:00
Ferhat
2132a0c7a3
Revert "[Perf/codesize] Reduce constraint member reads during layout (#51418)" (#51489)
This reverts commit 69080e07e6bb178332bf546cf83054a85b91b2fe.
2020-02-26 15:51:30 -08:00
Jonah Williams
cd97f23a93
ensure dart defines work on web and not web (#51505) 2020-02-26 14:59:49 -08:00
Greg Spencer
9e744c5710
Implement VisualDensity for text fields. (#51438)
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==.
2020-02-26 13:38:28 -08:00
Miguel Beltran
7ff3a50fe7
Set highContrast value from AccessibilityFeatures into MediaQueryData (#48811) 2020-02-26 13:36:02 -08:00
Dan Field
419a2853a8
Revert "Live image cache" (#51441)
* Revert "Live image cache (#51249)"

This reverts commit e2dcdb60e327f80d414d3d1e72e2863bf4c9252c.

* fix tests for other commit
2020-02-25 16:52:47 -08:00
Dan Field
7cbe55cf1a
Avoid caching image load failures that are retriable (#51398) 2020-02-25 14:56:04 -08:00
Greg Spencer
c71978f600
Remove deprecated DefaultFocusTraversal widget (#51240)
Remove deprecated DefaultFocusTraversal widget
2020-02-25 14:15:35 -08:00
Ferhat
69080e07e6
[Perf/codesize] Reduce constraint member reads during layout (#51418) 2020-02-25 13:50:21 -08:00
LongCatIsLooong
eb00c56205
fix symobol refs in the dynamic color doc (#46003) 2020-02-24 16:21:17 -08:00
Dan Field
e2dcdb60e3
Live image cache (#51249)
* Revert "Revert "Live image cache (#50318)" (#51131)"

This reverts commit 2f09d601b5a1632468714adb051d7f1e5a816ce4.

* Fix eviction of a pending image
2020-02-24 13:47:53 -08:00
Dmitry Ratushnyy
a70e4aec93
Material DataTable: added support of setting table row border thickness (#49692) 2020-02-24 09:46:03 -08:00
Michel Feinstein
92a028cf6d
Removed the unecessary "new" keyword from the docs (#51075) 2020-02-24 09:22:18 -08:00
sjindel-google
6f9ed76faf
Update covariant_templates_test after changes to TypeError. (#51330)
TypeError no longer implements AssertionError after https://github.com/dart-lang/sdk/issues/40317.
2020-02-24 16:52:11 +01:00
Aadarsh Patel
1d4667bb38
Fixed a typo (#51302) 2020-02-23 19:26:02 -08:00
Greg Spencer
c4345d2a0a
Add a sample for FocusTraversalGroup (#51161) 2020-02-22 16:54:06 -08:00
Shi-Hao Hong
6d4121c075
Fix tests that rely on FadeTransition incorrectly and depend on implementation details of FadeUpwardsTransitionBuilder (#51150) 2020-02-22 16:54:02 -08:00
Tanat Boozayaangool
bf8e2c1449
Fix typo in description for PointerEvent.radiusMax (#51149) 2020-02-21 14:21:25 -08:00
Shouichi Kamiya
e8e99e49f9
Fix TextEditingController doc to call super.initState first (#51089) 2020-02-21 14:16:04 -08:00
Greg Spencer
c5dd3ec47a
Fix stuck keys when shift is released before the letter. (#51095)
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).
2020-02-21 14:13:38 -08:00
Yegor
d5844e8a4a
Enable TextStyle hash test on the Web (#50985) 2020-02-21 11:26:03 -08:00
Dan Field
2f09d601b5
Revert "Live image cache (#50318)" (#51131)
This reverts commit 1602be6ab6529732b59cdc5ac36ec8439690329b.
2020-02-20 13:20:28 -08:00
Albertus Angga Raharja
aad941e3fa
Avoid using FlutterError.fromParts when possible (#43696)
This PR is a follow up of https://github.com/flutter/flutter/pull/42640
Some changes of that PR includes redundant changes using FlutterError.fromParts constructor even though it's not necessary.

Some minor changes are:

- Remove one unnecessary todo
- Fix indent consistencies
2020-02-20 07:51:53 -08:00
Alexandre Ardhuin
7d7ac7c32b
start multiline strings with newline (#50825) 2020-02-20 10:16:28 +01:00
Gary Qian
af17860513
Detect sync vs async obtainKey in ResizeImage (#51081) 2020-02-19 19:06:03 -08:00
Per Classon
74e564da2d
Add parameter to Scaffold so its possible to disable open Drawer drag gesture (#50925) 2020-02-19 18:51:04 -08:00
Greg Spencer
1793108ba1
Add additional focus samples. (#50846) 2020-02-19 18:41:03 -08:00
Darren Austin
7a83c6fcd4
Expose insetPadding and clipBehavior in Dialog and AlertDialog. (#50775) 2020-02-19 18:26:04 -08:00
Tjong Anthony
e7c90057c7
[Form] Add is valid to FormState (#48948) 2020-02-19 13:31:05 -08:00
najeira
4c5aef63a9
Fix comment typo FormField.initialState to FormField.initialValue (#51011) 2020-02-19 13:26:13 -08:00
Martin Kustermann
17de0c5319
Weaken stack-trace based tests to allow auto-roll of new engine which will change the format (#51047)
Follow-up PR will restore those tests with new expectations:
https://github.com/flutter/flutter/pull/50760
2020-02-19 10:05:40 -08:00
Shi-Hao Hong
89ff794ac8
InputDecorator prefixIconConstraints and suffixIconConstraints (#50058) 2020-02-18 11:31:04 -08:00
Dan Field
8aa67610f7
Avoid including a potentially animated invisible image (#50842)
* Avoid including a potentially animated invisible image
2020-02-18 11:29:55 -08:00
Jonah Williams
9b4cb4da72
[versions] reland update test to 1.12.0 (#50879) 2020-02-18 10:38:54 -08:00
Jonah Williams
e481fcae52
Revert "[version] update to package:test 1.12.0 (#50818)" (#50853)
This reverts commit d3387bc916da209506db3f07976208bb2f81f911.
2020-02-14 22:34:30 -08:00
Jonah Williams
d3387bc916
[version] update to package:test 1.12.0 (#50818) 2020-02-14 21:51:47 -08:00
Dan Field
1602be6ab6
Live image cache (#50318)
Track images available on screen
2020-02-14 15:03:05 -08:00
creativecreatorormaybenot
08c835913e
Expose showButtonMenu of PopupMenuButtonState (#50670) 2020-02-14 14:51:19 -08:00
Greg Spencer
18984101d9
Fix the spelling of manditory (#50746) 2020-02-14 08:43:02 -08:00
Taufiq Rahman
d1185337cc
Feature: Allow minLines in SelectableText (#50750)
* Feature: allow minLines in SelectableText
2020-02-14 06:38:13 -08:00
Yegor
b34046903b
Fix stack trace parsing on non-debug builds; add e2e tests (#50652)
* Fix stack trace parsing on non-debug builds; add e2e tests
2020-02-13 18:34:08 -08:00
Dan Field
766bd70598
Image tracing (#50648) 2020-02-13 14:04:02 -08:00
Gary Qian
8769f94cf6
Add textHeightBehavior and textWidthBasis to AnimatedDefaultTextStyle (#50748) 2020-02-13 16:52:31 -05:00
Shi-Hao Hong
1f3d423f92
Step 1: SnackBarBehavior.floating offset fix - Soft breaking change (#50597)
* Adds an opt-in flag to fix floating snackbar's offset when no floating action button is present. This flag will be removed once the migration for the fix is complete.

Co-authored-by: filaps <filip1997.28@mail.ru>
2020-02-13 10:04:31 -08:00
Shi-Hao Hong
a833effbc7
Reland Alert dialog overflow spacing (#50675)
* Add ButtonBar.overflowButtonSpacing

* Add AlertDialog overflow button spacing functionality
2020-02-13 10:00:15 -08:00
Greg Spencer
232063e5c3
Changed ThemeData DiagnosticProperties to DiagnosticLevel.debug (#50589) 2020-02-13 09:53:02 -08:00
Greg Spencer
d57d493507
Reland: Add OrderedFocusTraversalPolicy and FocusTraversalGrou… (#50672)
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.
2020-02-12 16:22:01 -08:00