1071 Commits

Author SHA1 Message Date
Greg Spencer
a085635899
Change the way ActionDispatcher is found. (#41245)
This changes the way ActionDispatchers are found by the Actions widget, so that by default it will look for dispatchers of the parent Actions widgets instead of just creating a default ActionDispatcher. This allows overriding of the ActionDispatcher at the top level: before, the custom action dispatcher would only be invoked if explicitly set on all the Actions widgets.

This is not a breaking change because there was a default value to the dispatcher parameter before that performed this function, and not specifying the dispatcher anywhere will still result in a default dispatcher being created.
2019-09-26 14:31:08 -07:00
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
Nurhan Turgut
ae529d8be0
Fixing the editable_text unit tests by clearing the log. Add a modification for also testing cached size. (#41300) 2019-09-25 13:14:59 -07:00
LongCatIsLooong
7bf9aea254
Fix user gesture in CupertinoPageRoute (#39590) 2019-09-25 00:37:12 -07:00
Alexandre Ardhuin
b873162194
fix some bad indentations (#41172) 2019-09-24 21:03:37 +02:00
Nurhan Turgut
f6e77a9ee5
Fixing a text editing bug happening when text field changes. (#41108)
* Carrying last size and transform information to TextInputConnection. Doing this we are making sure that the size/transform information from the previous connection will be removed, when connection changes.

* remove unused lastsize and lasttransform values

* Adding unit tests. Adressing comments.
2019-09-24 09:25:39 -07: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
Alexander Aprelev
bd929c4a52 Revert "Use separate isolate for image loading. (#34188)" (#40984)
This reverts commit b12bdd0ea13619903b9a56164c69e7e62410b723 as it
breaks existing tests that expect image loaded after certaing number of
pupms. With image loading done on separate isolate pumping is not
guaranteed to get image loaded.
2019-09-20 10:23:51 -07:00
chunhtai
0086243be4
Fixed Selectable text align is broken (#40709)
* Fixed Selectable text align is broken
2019-09-19 09:37:00 -07:00
Alexander Aprelev
b12bdd0ea1
Use separate isolate for image loading. (#34188)
* Use separate isolate for image loading. Use TransferableTypedData to const-cost receive bytes from that isolate.
2019-09-18 20:38:54 -07:00
Robin Jespersen
d4a016443b Adding onEnd callback to implicit animated widgets (#38979) 2019-09-18 14:56:18 -07:00
Michael Goderbauer
4373a31971
Reapply "Revert "Propagate textfield character limits to semantics (#40468)" (#40767) 2019-09-18 14:55:37 -07:00
chunhtai
6c457e124b
Material textselection context menu cannot disable select all (#40713) 2019-09-18 12:19: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
Alexandre Ardhuin
df4bf453ab
more UI-as-code (#35516) 2019-09-17 16:23:44 +02:00
Simon Lightfoot
bf216110ff Adds relayout option to CustomMultiChildLayout. (#39252) 2019-09-16 09:22:59 -07:00
LongCatIsLooong
64300123fa
Restore offstage and ticker mode after hero pop and the from hero is null (#40306) 2019-09-13 19:46:58 -07:00
LongCatIsLooong
19b47c2dd4
Dark Mode R: Refresh Control (#40454) 2019-09-13 17:18:20 -07:00
Michael Goderbauer
6dc9bf0a02
Fix curve for popping hero (#39844) 2019-09-11 14:55:59 -07:00
Michael Goderbauer
3f98fb7949
Ensure frame is scheduled when root widget is attached (#40105) 2019-09-10 13:26:09 -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
chunhtai
57d714ebb8
fix widget built twice during warm up frame (#39079) 2019-09-06 09:46:18 -07:00
Konstantin Scheglov
3118ae19ff
Fix new prefer_const_constructors after analyzer fix. (#39917) 2019-09-05 19:59:24 -07:00
Michael Goderbauer
e2325600ea
Do not render any frames when just initializing Bindings (#39535) 2019-09-05 17:08:50 -07:00
Mouad Debbar
2640bfeb10
Allow gaps in the initial route (#39440) 2019-09-05 09:51:35 -07: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
chunhtai
36a7e3f0ef
fix sliverfixedextent with sliverchildbuilderdelegate does not correct calculate max scroll extent (#39142) 2019-09-03 10:27:37 -07:00
Mouad Debbar
a2957c571e
Upstream changes necessary for text editing in flutter web (#39344) 2019-08-30 10:00:03 -07:00
Harry Terkelsen
13bd52bf9e
Add HtmlElementView (the Flutter Web platform view) (#37819)
* Implement HtmlView, the platform view widget for Flutter Web

* Document HtmlView constructor

* Respond to review comments

* - Rename to HtmlElementView
- Assert running on web
- Move test to Chrome-only file
2019-08-29 12:49:04 -07:00
Tong Mu
4fc11db5cc
Add IterableFlagsProperty and use it on proxy box classes (#39354)
* Add FlagsSummary and implement Listener
2019-08-29 10:07:48 -07:00
Harry Terkelsen
9f4ab273f1
Add viewType to PlatformViewLink (#39446)
* Add viewType to PlatformViewLink

Re-initialize the controller when the viewType changes.

* Re-word `PlatformViewLink` doc comment for clarity
2019-08-28 20:02:08 -07:00
Kenzie Schmoll
13f18d5a66
Make inspector details subtree depth configurable. (#39085)
* Make inspector details subtree depth configurable.
2019-08-28 14:02:12 -07:00
Andrei Lesnitsky
35de8d5278 respect reversed scroll views (#39195)
This PR makes Scrollable scroll in correct direction when reverse: true on desktop and web
2019-08-28 06:49:49 -07:00
Chris Yang
7f5540faac
PlatformViewLink handles focus (#38643)
In the build of PlatformViewLink, Added a FocusNode wrapping around the surface widget.
The focus node will ask platform view to clear its focus when necessary through [PlatformViewController.clearFocus].
The platform view can notify the framework it wants to gain focus by calling [PlatformViewCreationParams.onFocusChanged]
2019-08-26 12:04:17 -07:00
Hans Muller
cf87f68fd0
Correct InheritedTheme.captureAll() for multiple theme ancestors of the same type (#39089) 2019-08-23 09:41:03 -07:00
Greg Spencer
055c548902
Fix KeySet<T> (and LogicalKeySet, PhysicalKeySet) hashCode calculation (#38936)
This fixes the hashCode calculation for KeySet<T> so that it doesn't depend on the insertion order of the keys in the set.

The fix involves switching from Set<T> to HashSet<T> internally, so that the iteration order is stable around the hash values of the inserted keys, and not the insertion order. This matters when hashList is called in KeySet<T>.hashCode to build the hash value of the contents of the internal set.

Fixes #38919
2019-08-23 07:51:35 -07:00
Michael Goderbauer
97df403398
TweenAnimationBuilder for building custom animations without managing an AnimationController (#38317) 2019-08-22 20:48:53 -07:00
Shi-Hao Hong
f0656ac37d
Explain const values in MediaQuery test file (#39059) 2019-08-22 13:43:17 -04:00
Shi-Hao Hong
3b7410476f
Add MediaQuery.systemGestureInsets to support Android Q (#37416)
* Wire Window.systemGestureInsets to MediaQuery.systemGestureInsets

* Add systemGestureInsets property to TestWindow
2019-08-22 00:34:11 -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
LongCatIsLooong
9aea03f4af
Implement PageView using SliverLayoutBuilder, Deprecate RenderSliverFillViewport (#37024) 2019-08-21 15:02:24 -07:00
Nigel Gott
bf097eec87 Fix DragTarget not being rebuilt when a rejected Draggable enters #38786 (#38789) 2019-08-21 14:53:18 -07:00
Hans Muller
2e01eef5aa
Added InheritedTheme (#38583) 2019-08-21 14:02:19 -07: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
chunhtai
878fe20a85
fix widgetspan does not work with ellipsis in text widget (#38699) 2019-08-20 09:41:21 -07:00
Gary Qian
fb5b157098
Clamp scrollOffset to prevent textfield bouncing (#38573) 2019-08-19 12:45:52 -07:00
Greg Spencer
d6938c56d9
Adds canRequestFocus toggle to FocusNode (#38704)
* Add an 'unfocusable' focus node to allow developers to indicate when they don't want a Focus widget to be active

* more unfocusable changes. not working.

* Switch to focusable attribute

* Rename to canRequestFocus

* Turn off debug output

* Update docs

* Removed unused import
2019-08-16 15:27:49 -07:00