1132 Commits

Author SHA1 Message Date
Greg Spencer
1a7bb1f583
Added proper focus handling when pushing and popping routes (#40166)
The proposed change will change focus handling when pushing and popping routes so that the FocusScopeNode for the route receives focus when pushed, and that the FocusScopeNode in the navigator receives focus when the route is popped.

This means that the last setFirstFocus call on the scope is used to determine which control actually receives focus. When the focus scope receives focus, it traverses its children, trying to find a non-scope node that is the "first focus" of itself or a child node.

This is a breaking change, because the focus behavior has changed. If you push a route after this change, and had a 'first focus' set on a widget via FocusScopeNode.setFirstFocus, it won't currently receive focus immediately, but after this change it will. Similarly, if you pop a route after this change, the focus will go back to where it was before the route was pushed, which is correct, but different from what happens now.
2019-09-26 14:30:39 -07:00
Greg Spencer
0509791663
Fix mouse hover to not schedule a frame for every mouse move. (#41014)
This fixes the mouse hover code to not schedule frames with every mouse move.

Before this, it would schedule a post frame callback, and then schedule a frame immediately, even if there was nothing that needed to be updated. Now it will schedule checks for mouse position updates synchronously, unless there's a new annotation, and skip scheduling a new frame in all cases. It has to be async in the case of a new annotation (i.e. a new MouseRegion is added), since when the annotation is added, it hasn't yet painted, and it can't hit test against the new layer until after the paint, so in that case it schedules a post frame callback, but since it's already building a frame when it does that, it doesn't need to schedule a frame.

The code also used to do mouse position checks for all mice if only one mouse changed position. I fixed this part too, so that it will only check position for the mouse that changed.
2019-09-26 13:13:42 -07:00
Hans Muller
e47a1dc216
Dropdown Menu layout respects menu items intrinsic sizes (#41120) 2019-09-26 07:18:25 -07:00
imzyy
964dc1fc30 Add fullscreenDialog argument in PageRouteBuilder (#40161) 2019-09-24 16:54:44 -07:00
Hans Muller
09073a08b8
Rebuild modal routes when the value of userGestureInProgress changes (#41150) 2019-09-24 16:03:31 -07:00
Alexandre Ardhuin
b873162194
fix some bad indentations (#41172) 2019-09-24 21:03:37 +02:00
Greg Spencer
0e6cb28dbe
Add fake keyboard key generation to the testing framework (#40706)
There were four or five different implementations in various tests for sendFakeKeyEvent, which roughly all did the same thing. I was going to add yet another one, and decided that it needed to be generalized and centralized. This replaces those instances with something that just takes a LogicalKeyboardKey so that it's self-documenting, and can be used with multiple platforms.

This adds two functions to widget tester: sendKeyDownEvent and sendKeyUpEvent which simulate key up/down from a physical keyboard. It also adds global functions simulateKeyDownEvent and simulateKeyUpEvent that can be called without a widget tester. All are async functions protected by the async guard.
2019-09-24 08:14:38 -07:00
Alexandre Ardhuin
e9965f5636
add missing trailing commas in packages/flutter (#41076) 2019-09-24 08:05:41 +02:00
Michael Goderbauer
4373a31971
Reapply "Revert "Propagate textfield character limits to semantics (#40468)" (#40767) 2019-09-18 14:55:37 -07:00
Michael Goderbauer
b4324aed59
Revert "Propagate textfield character limits to semantics (#40468)" (#40714)
This reverts commit 6ad88bd5c01897ee3c5743a99e75350f87388819.
2019-09-17 16:37:11 -07:00
Michael Goderbauer
6ad88bd5c0
Propagate textfield character limits to semantics (#40468) 2019-09-17 14:39:50 -07:00
Anthony
c17086a06d
Add the option to configure a chip check mark color (#40608)
Add the option to configure a chip check mark color
2019-09-17 14:17:34 -04:00
xster
fab3eb21c2
Let Material BackButton have a custom onPressed handler (#39600) 2019-09-17 11:09:18 -07:00
Hans Muller
6d18c20a95
Update PopupMenu layout (#40179) 2019-09-17 08:48:27 -07:00
Alexandre Ardhuin
df4bf453ab
more UI-as-code (#35516) 2019-09-17 16:23:44 +02:00
Hans Muller
0f00f424fa
ModalRoutes ignore input when a (cupertino) pop transition is underway (#40466) 2019-09-16 08:02:04 -07:00
Shi-Hao Hong
cf7e7e4529
Implement DropdownButton.selectedItemBuilder (#40461)
* Implement DropdownButton.selectedItemBuilder
2019-09-14 07:56:05 -07:00
Michael Goderbauer
9d70c85f5a
a11y improvements for textfield (#40390) 2019-09-13 09:23:27 -07:00
Shi-Hao Hong
2bd7f9ff7d
Update ToggleButtons constraints default and add new constraints parameter (#39857)
* Add constraints property, updated default constraints for ToggleButtons to 48x48

* Add kMinInteractiveDimension constant to ToggleButtons
2019-09-13 08:19:06 -07:00
Greg Spencer
a7c06e113b
Fixed passing autofocus to MaterialButton, and when rebuilding Focus widget. (#39903)
Fixed passing autofocus to MaterialButton, and when rebuilding Focus widget, and added a test for Focus and MaterialButton to test that it works properly.
2019-09-10 10:29:58 -07:00
Sarbagya Dhaubanjar
45d57e780f Added properties in DropdownButtonFormField to match DropdownButton (#36998)
* Added properties in DropdownFormField to match DropdownButton

* Minor style guide related changes
2019-09-09 21:11:23 -07:00
Slade Capasso
4c254e5e8a Updates to debugFillProperties to test all properties in slider.dart and slider_test.dart (#39632) 2019-09-09 18:31:40 -07:00
lisa-liao
8b90d9d045 Allow independent theming of Persistent and Modal bottom sheets Background Color (#39333) 2019-09-06 13:06:01 -04:00
Shi-Hao Hong
abfc560b9d
ToggleButtons test improvement (#38898)
* Improve finders throughout toggle_buttons_test.dart

* Improve Material finders

* Update toggle_buttons_theme_test.dart finders to be more precise

* Refactor out textStyle and iconTheme finders

* Refactor iconTheme and buttonTextTheme logic
2019-09-05 15:12:36 -07:00
Anthony
3932ffb1cd Revert "Show search app bar theme (#37962)" (#39786)
This reverts commit e3f8d0554089a0c391ff8078af42e1ae2ba32e22.
2019-09-04 20:13:16 -07:00
rami-a
af9f210443
Fix single action banner to ensure button alignment (#39583) 2019-09-04 09:41:46 -04:00
Greg Spencer
f9bc89932c
Re-Land of HighlightMode change with benchmark improvements. (#39589)
* Automatic focus highlight mode for FocusManager

This re-lands the highlight mode change.

* Review Changes
2019-09-03 17:49:41 -07:00
Greg Spencer
8daa165d01
Make disabled buttons/chips/text fields not be focusable. (#38726)
This changes the behavior of text fields, Material buttons, and Chips so that if they are disabled they lose focus. Before this change, it was possible to disable a control and then use focus traversal to reach it anyhow, and in the case of text fields, enter text into a disabled field.

Fixes #33985
2019-09-03 07:51:28 -07:00
rami-a
0ebcfe10da
Prevent exception when creating a Divider borderSide (#39572) 2019-09-03 10:15:42 -04:00
Anthony
e3f8d05540
Show search app bar theme (#37962)
Use the entire appBarTheme from the showSearch delegate for the search pages appBar theme, rather than just a select set of fields.
2019-09-02 14:23:42 -04:00
Jonah Williams
73b798b260
Revert "Better docs for text (#38922)" (#39447)
This reverts commit ddd31bcee74c2da986f9764f1af31ae50b3c3557.
2019-08-28 16:01:47 -07:00
Ian Hickson
ddd31bcee7 Better docs for text (#38922) 2019-08-28 14:41:09 -07:00
Justin McCandless
d3b70c91bf
Add the textAlignVertical param to TextFormField (#39144) 2019-08-27 19:08:35 -07:00
Hans Muller
35c916d733
Added Scaffold.extendBodyBehindAppBar (#39156)
* Co-authored-by: Brett Morgan <brettmorgan@google.com>
2019-08-26 11:31:19 -07:00
Greg Spencer
365f577c70
Normalize assert checking of clipBehavior (#38568)
I noticed that we were pretty inconsistent with the way that we checked the value of clipBehavior in the framework, so I normalized the usages and updated docs where necessary.

This is a breaking change if you used to pass null explicitly to FlatButton, OutlineButton or RaisedButton constructors, expecting to get Clip.none. It will now assert if you do that. Existing implementations that pass null implicitly by not specifying clipBehavior won't need to change their call sites. It always implicitly defaulted to Clip.none before, and it will continue to do that, it's only places where it was explicitly set to null in order to get the implicit default that it will fail.
2019-08-23 14:08:04 -07:00
lisa-liao
ae847d9730 Allow independent theming of Persistent and Modal bottom sheets (#38650)
BottomSheetThemeData has an additional field modalElevation which makes it possible to set different elevations between persistent and modal bottom sheets.
2019-08-22 13:58:39 -04:00
adazh
93c32c4ff6
Moved the default BinaryMessenger instance to ServicesBinding (#38464)
* Moved the default BinaryMessenger instance to ServicesBinding

This reverts commit 821602aef36983d416836e5d6fcc78fe9d3facb1.

* Added assertion in defaultBinaryMessenger. Also fixed the devicelab tests.
2019-08-21 16:47:42 -07:00
Hans Muller
2e01eef5aa
Added InheritedTheme (#38583) 2019-08-21 14:02:19 -07:00
rami-a
6a5d32962c
[Material] Add clip property to bottom sheet and theme (#38831) 2019-08-21 16:14:52 -04:00
Greg Spencer
f515bf6abc
Revert "Automatic focus highlight mode for FocusManager (#37825)" (#38866)
This reverts commit a11d73148c90dd2980f0ab5a2d88159269937e3a because of a regression in
flutter_gallery_ios32__transition_perf's 90th_percentile_frame_build_time_millis.

Fixes #38860.
2019-08-20 18:50:09 -07:00
Shi-Hao Hong
b7abf56a0b
Add ToggleButtons.textStyle property (#38813)
* Add ToggleButtons.textStyle property
2019-08-20 13:02:18 -04:00
rami-a
109893c6cf
[Material] Add contentPadding property to SwitchListTile (#38709) 2019-08-20 09:55:29 -04:00
Darren Austin
9dce19e96f
Replace ButtonBar.bar method with ButtonBarTheme (#37544)
* Added new ButtonBarTheme to replace the deprecated ButtonTheme.bar method.

* Responding to PR feedback.

* [Material] Create material Banner component (#36880)

This PR creates a new material widget for the Banner component. This includes a theme as well. This widget can be dropped into any application, ideally at the top of a listview or scrollview.

(cherry picked from commit 35b6d668e197035ea2b57adb99041542982e8be0)

Removed the use of ButtonTheme.bar in the Banner implementation.

* Updated documentation from PR review comments.
2019-08-19 17:35:44 -07:00
Michel Feinstein
1a5e4a5d7f Adds the arrowColor option to UserAccountsDrawerHeader (#38608) (#38636)
Changes a hard-coded value to a controllable parameter.
2019-08-16 15:14:14 -07:00
Greg Spencer
a11d73148c
Automatic focus highlight mode for FocusManager (#37825)
This adds a FocusHighlightMode to the FocusManager that switches based on the type of input that has recently been received. The initial value is based on the platform, but is updated as soon as user input is received. There is also a FocusHighlightStrategy enum so that the developer can change the strategy to a fixed value if needed.

The default is to automatically detect the mode based on the last type of user input. If they use a mouse or keyboard, it shows the focus highlights. If they use a touch interface, then the highlights disappear. This is consistent with the way that Android and Chrome work. The controls still receive focus, only the display of the highlight changes.

Text fields show the focus highlight regardless of the focus highlight mode.
2019-08-16 10:40:08 -07:00
rami-a
13844aa62a
[Material] Create theme for Dividers to enable customization of thickness (#38621) 2019-08-16 13:09:36 -04:00
MH Johnson
1033155fb9
[Material] Add splashColor to FAB and FAB ThemeData (#38467)
* [Material] Add splashColor param to FAB and FAB ThemeData
2019-08-15 13:12:21 -04:00
MH Johnson
17ddfb1b42
make RawChip.selected non-nullable (#37556) 2019-08-13 17:36:44 -04:00
Shi-Hao Hong
2003432cd8
Drawer edge drag width improvements (#37492)
* Added customizable drawer edge drag width parameter to Drawer and Scaffold

* Fix Drawer drag area width for notched devices

* Update Drawer tests to reflect necessary LTR and RTL Drawer edge widths
2019-08-12 18:20:35 -04:00
Shi-Hao Hong
0f3919e539
Adds DefaultTextStyle ancestor to Tooltip Overlay (#37877)
* Add DefaultTextStyle parent widget to Tooltip Overlay

* Add test against fallback DefaultTextStyle
2019-08-12 17:24:51 -04:00