233 Commits

Author SHA1 Message Date
Alexandre Ardhuin
d546e1d311
fix for upcoming lint use_named_constants (#74788) 2021-01-27 20:20:44 +01:00
LongCatIsLooong
61299b1621
Revert "[text_input] prepare for custom text input sources (#72803)" (#74349) 2021-01-20 13:54:06 -08:00
J-P Nurmi
b73722b1d9
[text_input] prepare for custom text input sources (#72803) 2021-01-15 11:24:04 -08:00
Gary Qian
49667ba2f5
DeferredComponent utility class for manual handling of Deferred Components (#72895) 2021-01-13 14:04:06 -08:00
LongCatIsLooong
4220e00fff
Revert "squash commits (#68166)" (#73067) 2020-12-29 11:39:04 -08:00
LongCatIsLooong
ce0ec01f64
squash commits (#68166) 2020-12-28 12:29:02 -08:00
xster
ca82c572b7
Revert "let NOTICES be double gzip wrapped to reduce on-disk installed space (#71899)" (#72438) 2020-12-16 10:58:19 -08:00
xster
4ed3432e8f
let NOTICES be double gzip wrapped to reduce on-disk installed space (#71899) 2020-12-15 13:29:14 -08:00
Alex Li
63062a6443
Deprecate maxLengthEnforced for text fields (#72043) 2020-12-13 23:19:13 +08:00
Shi-Hao Hong
7cb2834a8b
StandardMethodCodec.decodeEnvelope should allow null error message (#71807)
* StandardMethodCodec.decodeEnvelope should allow null error message
2020-12-08 08:04:30 +08:00
Jonah Williams
e5000f6cea
[flutter_tools] Remove usage of --precompiled flag for web tests (#70977) 2020-12-01 09:54:01 -08:00
Jonah Williams
cfb63356c3
[flutter_tools] use frontend_server for web test compilation (#70714) 2020-11-18 14:55:26 -08:00
Omar Emara
273efff072
Correct GtkKeyHelper key codes for the Meta key (#69576) 2020-11-11 15:24:04 -08:00
Alexandre Ardhuin
17cdf5559d
enable unnecessary_string_escapes and use_raw_strings (#68302) (#69025) 2020-10-26 12:42:05 -07:00
puelo
24d3999783
Generate RawKeyEvents for iOS 13.4+ (#65193)
* Added RawKeyEvent support for iOS

* Removed unused remnant

* added some missing keys

* Removed trailing whitespaces

* commit for build

* Added mapping names

* Made iOS keycodes generatable and collectable

* Fixed naming and formatting issues

* fixed raw_keyboard_test
2020-10-22 13:33:51 -07:00
Michael Goderbauer
42f3709a5a
Sound null safety for framework and flutter_test (#68642) 2020-10-21 10:09:11 -07:00
Zachary Anderson
cbcd1321ed
Revert "enable unnecessary_string_escapes and use_raw_strings (#68302)" (#68714)
This reverts commit ae06c19a371cbf8eb9de84d0c3d880c7cd101683.
2020-10-21 08:16:13 -07:00
Alexandre Ardhuin
ae06c19a37
enable unnecessary_string_escapes and use_raw_strings (#68302) 2020-10-21 16:34:24 +02:00
Greg Spencer
8c03ff8c1d
Mark keys that match a shortcut, but have no action defined as "not handled". (#67359)
- - When I added notification of key events before processing them as text, it made it so that shortcut key bindings like the spacebar would prevent spaces from being inserted into text fields, which is obviously not desirable (and so that change was reverted). At the same time, we do want to make it possible to override key events so that they can do things like intercept a tab key or arrow keys that change the focus.

This PR changes the behavior of the Shortcuts widget so that if it has a shortcut defined, but no action is bound to the intent, then instead of responding that the key is "handled", it responds as if nothing handled it. This allows the engine to continue to process the key as text entry.

This PR includes:

- Modification of the callback type for key handlers to return a KeyEventResult instead of a bool, so that we can return more information (i.e. the extra state of "stop propagation").
- Modification of the ActionDispatcher.invokeAction contract to require that Action.isEnabled return true before calling it. It will now assert if the action isn't enabled when invokeAction is called. This is to allow optimization of the number of calls to isEnabled, since the shortcuts widget now wants to know if the action was enabled before deciding to either handle the key or to return ignored.
- Modification to ShortcutManager.handleKeypress to return KeyEventResult.ignored for keys which don't have an enabled action associated with them.
- Adds an attribute to DoNothingAction that allows it to mark a key as not handled, even though it does have an action associated with it. This will allow disabling of a shortcut for a subtree.
2020-10-19 11:26:50 -07:00
Kate Lovett
5aef988adc
[NNBD] Migrate some Widgets tests (#68157) 2020-10-15 15:42:05 -07:00
Yash Johri
0a130100ac
Updated tests (#67083) 2020-10-14 15:22:04 -07:00
Greg Spencer
58287aceef
Convert services tests to NNBD (#62694)
This converts the packages/flutter/test/services directory to NNBD, now that the services package is converted.

I changed the signature of checkMessageHandler and checkMockMessageHandler on BinaryMessenger to take a nullable handler, since the tests wanted to check to make sure a handler wasn't set, and that functionality no longer works if the handler is non-nullable.
2020-10-08 13:46:44 -07:00
Michael Goderbauer
42fa4f033b
Migrate some more non-test utils for tests (#67351) 2020-10-05 18:12:04 -07:00
Michael Goderbauer
cbf1e135c4
Migrate non-test files in flutter/test (#67098) 2020-10-02 21:57:04 -07:00
Ian Hickson
cb232ddad5
Prevent a potential infinite loop. (#66073) 2020-09-21 11:22:07 -07:00
Michael R Fairhurst
7f3c9b6bda
Remove unused 'dart:async' imports. (#65568) 2020-09-16 14:14:06 -07:00
Greg Spencer
199a7c1964
Fix the character field of the RawKeyEvent to hold correct data on non-Android platforms. (#65667)
This fixes a problem where the character field of the RawKeyEvent was not being set at all for non-Android platforms.

I also updated the key maps, and corrected a problem with the Windows key map where the backquote character wasn't correctly mapped.
2020-09-15 13:02:16 -07:00
Ian Hickson
b3d1ebf117
Move the registration of the restoration channel to binding initialization. (#65579) 2020-09-11 16:30:05 -07:00
LI DONGZE
abbd5b149a
Add native stacktrace field for PlatformException. (#64199) 2020-08-20 15:01:06 -07:00
Greg Spencer
041a3eaa84
Standardize the nullability of arguments to raw key data constructors. (#63523)
This standardizes the handling of nullability for the LogicalKeyboardKey.keyLabel and RawKeyEventData.keyLabel accessors so that they are non-nullable, but can be empty.

Before this change, the keyLabel could be either null or an empty string to indicate that there wasn't a label, which makes it harder to test for, since both need to be checked for. Since an empty string is sufficient, there is no need for it to be nullable.

Also, in raw_keyboard.dart, the web and Windows implementations wouldn't accept null values for parameters in the Map coming from the message, but tests were supplying null for some of them. This makes web and Windows creation of events match the other platforms, and makes the migration of tests to non-nullability easier.
2020-08-19 15:03:17 -07:00
Mouad Debbar
2b67846aab
Make SelectableText work better on web (#63786) 2020-08-19 13:31:06 -07:00
Michael Goderbauer
39a46bedad
Remove decommission from RestorationBuckets (#63687) 2020-08-13 15:01:04 -07:00
Jonah Williams
9e162cb310
Revert "Add native stacktrace field for PlatformException (#63502)" (#63705)
This reverts commit c67eafa87d2de441a195a8aa46c92eac37ce4616.
2020-08-13 14:03:11 -07:00
LI DONGZE
c67eafa87d
Add native stacktrace field for PlatformException (#63502)
* Add native stacktrace field for PlatformException

* Mute the readValue check for stacktrace.

* polish

* Add unit test and further polish

* Added more comments

* remove unnecessary import

* fill in stacktrace to JSONMethodCodec and fix tests

* fix style

* Fix format

* Remove unnecessary TODO since not all explicitly declared errors have stacktrace in it from native side.

* Handle case for exception without stacktrace on jsonMethodCodec

* Add more unit tests

* format test

Co-authored-by: Ben Li <libe@google.com>
2020-08-13 11:43:50 -07:00
Konstantin Scheglov
bd1a58a991
Add arguments for required parameters. (#63598) 2020-08-13 08:16:33 -07:00
Greg Spencer
54095e1b61
Make modifier key side handling consistent among platforms (#63417)
This makes the processing of RawKeyboardEventData.getModifierSide consistent among the platforms.

Before this change, some platforms (Android) didn't handle the case where the "either" flag was set, but no side flag was set (e.g. "shift" was set, but not "shift left"), and instead said that no keys were down by returning null (which was wrong).

Some platforms (Linux, Windows) also returned KeyboardSide.any from getModifierSide, when the contract says that it will never return KeyboardSide.any. Those methods now return KeyboardSide.all in the case where no side is specified, as macOS and Fuchsia already did.

Now, all platforms will return KeyboardSide.all from getModifierSide when it's not clear which side the key was on.
2020-08-11 14:44:40 -07:00
guolinaileen
cbe0999d1f
Introduce onAppPrivateCommand to TextField (#62712) 2020-08-11 11:31:02 -07:00
Greg Spencer
0ec0bf505e
Make RawKeyboard assert when no keys are in keysPressed when sending a key down event. (#63426)
This adds an assert in RawKeyboard that catches the case where it tries to send a key down event, but (after synchronizing modifiers) there are no keys in keysPressed. This state can occur if the modifier flags are not set properly for the platform.

Also prevents shortcuts attempting to handle a key down when no keys are pressed at the moment (which was causing a crash in release mode).
2020-08-11 09:37:30 -07:00
Michael Goderbauer
25de941927
Make Scrollables restorable (#63131) 2020-08-10 21:01:10 -07:00
Jonah Williams
f4e442fe80
Revert "Add native stacktrace field for PlatformException (#62828)" (#63431)
This reverts commit 74b5051cd67aeaa1344a31f7a731e619ec82168b.
2020-08-10 15:16:29 -07:00
LI DONGZE
74b5051cd6
Add native stacktrace field for PlatformException (#62828)
* Add native stacktrace field for PlatformException

* Mute the readValue check for stacktrace.

* polish

* Add unit test and further polish

* Added more comments

* remove unnecessary import

* fill in stacktrace to JSONMethodCodec and fix tests

Co-authored-by: Ben Li <libe@google.com>
2020-08-10 13:29:58 -07:00
Nolan Scobie
43c1b34cf5
Add punctuation for unterminated sentences in doc comments (#62755)
* Add punctuation for unterminated sentences in doc comments

* Addressing review nit
2020-08-06 19:18:52 -04:00
Michael Goderbauer
175e5c9aca
Restoration Framework (#60375)
* state restoration

* added example

* typos and analyzer

* whitespace

* more typos

* remove unnecessary import

* whitespace

* fix sample code

* tests for restorationmanager and restorationid

* ++

* typo

* tests for bucket, part1

* rename tests

* more tests

* finished tests for service layer

* remove wrong todo

* ++

* review comments

* tests for Unmanaged and regular scope

* RootRestorationScope tests

* typo

* whitespace

* testing framework

* tests for properties

* last set of tests

* analyzer

* typo

* dan review

* whitespace

* ++

* refactor finalizers

* ++

* ++

* dispose guard

* ++

* ++

* dan review

* add manager assert

* ++

* analyzer

* greg review

* fix typo

* Ian & John review

* ian review

* RestorationID -> String

* revert comment

* Make primitives non-nullable in prep for NNBD
2020-07-28 10:16:36 -07:00
Konstantin Scheglov
741e9675e7
Remote returns for function expression inferred return type void. (#61582) 2020-07-17 09:36:03 -07:00
Jonah Williams
d14a898f69
remove LICENSE/NOTICES work around (#61199)
Now that google3 has been updated, remove the LICENSE loading fallback. This was done in cl/320506032

#16723
2020-07-10 11:37:48 -07:00
LongCatIsLooong
a6ce2d4bc7
Assert valid composing TextRange (#60956) 2020-07-08 21:21:02 -07:00
Kate Lovett
b345ecc11b
Skip Audit - Scheduler and Services libraries (#60934) 2020-07-08 18:16:08 -07:00
Maurice Parrish
7d7907e6c1
Fix bug where dispose message requires a map (#61035) 2020-07-08 09:57:34 -07:00
Maurice Parrish
dcbc694b58
Have AndroidViewController extend PlatformViewController and add support for hybrid platform views (#60320) 2020-07-05 11:43:02 -07:00
Greg Spencer
c68758fab1
Implement delayed key event synthesis support for Android (#59358) 2020-06-24 21:23:02 -07:00