Commit Graph

368 Commits

Author SHA1 Message Date
Hans Muller
890e6ccea6
Replaced obsolete use of FlatButton with TextButton (#66597) 2020-09-25 07:31:56 -07:00
Michael R Fairhurst
7f3c9b6bda
Remove unused 'dart:async' imports. (#65568) 2020-09-16 14:14:06 -07:00
Mouad Debbar
0d8de393aa
[web] Don't show handles when selection change is caused by keyboard (#65127) 2020-09-09 15:40:06 -07:00
Chris Bracken
c0ea00ed3f
Prefer moreOrLessEquals over closeTo (#64915)
Flutter's `moreOrLessEquals` has a few advantages over `closeTo` from
the `matcher` package:

   * It emits the epsilon value in the test result on failure.
   * It uses a named parameter for epsilon, which improves readability
     at the call site.
   * It has a reasonable default for epsilon in cases where something
     more specific isn't required.

Using it also has the nice property that it aids in its own discovery
when when people go looking for such functionality in new tests.

This change also includes a couple unrelated whitespace formatting cleanups.
2020-08-30 22:20:16 -07:00
Ming Lyu (CareF)
c2368bdd6f
bug fix for pointer id in test gestures (#63816) 2020-08-15 10:41:02 -07:00
Mouad Debbar
d13b56a0cd
Don't move to word edge when tapping with a mouse (#60177) 2020-08-05 19:16:06 -07:00
Pierre-Louis
5d854f63a0
Implement customizable cursor height (#61714) 2020-07-21 07:36:03 -07:00
Pierre-Louis
0bc4368233
Typo sweep (#60693) 2020-07-02 13:08:02 -07:00
Justin McCandless
2a573a32fe
Reland Characters Usage (#59778)
Use Dart's characters package to fix user-facing grapheme cluster bugs.
2020-06-23 15:28:26 -07:00
Justin McCandless
c105708426
RTL caret position (#60009) 2020-06-22 18:58:03 -07:00
Tong Mu
9470b9e2ce
Add material state mouse cursor to TextField (#59363) 2020-06-22 18:38:03 -07:00
Jason Simmons
4173881bbf
Fix the paste button label in the new version of the filtered text pasting test (#59865) 2020-06-19 12:41:29 -07:00
Christopher Fujino
5cfb16b193
Re-land "Deprecate WhitelistingTextInputFormatter and BlacklistingTextInputFormatter (#59120)" (#59876)
This relands #59120, which was reverted in #59870.
2020-06-19 12:03:38 -07:00
Christopher Fujino
0d7ff7a9e7
Revert "Deprecate WhitelistingTextInputFormatter and BlacklistingTextInputFormatter (#59120)" (#59870)
This reverts commit 8665e13801.
2020-06-19 10:52:52 -07:00
Ian Hickson
8665e13801
Deprecate WhitelistingTextInputFormatter and BlacklistingTextInputFormatter (#59120) 2020-06-18 18:08:01 -07:00
Justin McCandless
339f0363a6
Reland modernize selection menu appearance (#59617) 2020-06-18 16:33:03 -07:00
renyou
a99d146ba9
Revert "Characters Package (#53381)" (#59677)
This reverts commit e0ed12c73a.
2020-06-17 08:39:34 -07:00
Justin McCandless
e0ed12c73a
Characters Package (#53381) 2020-06-16 16:53:04 -07:00
Zachary Anderson
f8a4008e41
Revert "Modernize selection menu appearance (#59115)" (#59561)
This reverts commit b3c237ce54.
2020-06-16 08:41:22 -07:00
Justin McCandless
b3c237ce54
Modernize selection menu appearance (#59115) 2020-06-15 09:40:04 -07:00
Alexandre Ardhuin
4d7525f05c
Opt out nnbd in packages/flutter (#59186)
* add language version 2.8 in packages/flutter

* enable non-nullable analyzer flag
2020-06-11 14:11:30 +02:00
Nils Reichardt
3e273b14e2
[web & desktop] Hide all characters in a TextField, when obscureText is true on web & desktop (#56794) 2020-06-05 15:18:01 -07:00
Tong Mu
60f1aa25d3
Add mouse cursor API to widgets (phase 1) (#57628)
* Adds default cursor and/or mouseCursor property to a number of widgets.
* Adds `MaterialStateMouseCurrsor`.
2020-05-28 13:16:31 -07:00
Greg Spencer
8ef2915453
Add MediaQueryData.navigationMode and allow controls to be focused when disabled. (#54919)
This adds a new navigationMode to the MediaQueryData that indicates how focusable controls should behave under different navigation modes, currently with two modes: NavigationMode.traditional, and NavigationMode.directional.

It may seem like focusing a disabled control is not desirable, but this is useful for user interfaces that use DPAD navigation because if a control gets disabled, losing focus is disruptive to the user, and it is difficult to control where the focus will end up unless it is done explicitly.
2020-05-27 15:30:19 -07:00
Justin McCandless
53d7f24521
Fix Web asking for clipboard permissions (#57324) 2020-05-19 17:57:04 -07:00
nturgut
32547dcc7e
Revert " Bring back paste button hide behavior 3 (#57139)" (#57286)
This reverts commit 8de07d5527.
2020-05-15 10:42:37 -07:00
Justin McCandless
8de07d5527
Bring back paste button hide behavior 3 (#57139) 2020-05-14 11:37:02 -07:00
Jenn Magder
c969b8af7b
Revert "Bring back paste button hide behavior 2 (#56922)" (#56951)
This reverts commit d988226374.
2020-05-11 15:28:10 -07:00
Justin McCandless
d988226374
Bring back paste button hide behavior 2 (#56922)
Unrevert of paste button hides when nothing to paste
2020-05-11 13:23:24 -07:00
Mehmet Fidanboylu
0786f29ff2
Revert "Bring back paste button hide behavior (#56689)" (#56806)
This reverts commit d56349822d.
2020-05-09 20:22:17 -07:00
Justin McCandless
d56349822d
Bring back paste button hide behavior (#56689)
Unreverts #54902 with fixes for a failing integration test.
2020-05-08 13:41:22 -07:00
Justin McCandless
cd67da260e
Revert "Paste shows only when content on clipboard (#54902)" (#56614)
This reverts commit 053c38818f.
2020-05-07 17:28:37 -07:00
Justin McCandless
053c38818f
Paste shows only when content on clipboard (#54902) 2020-05-07 15:22:03 -07:00
Justin McCandless
43ce3fd988
TextField enabled fix (#55775) 2020-04-28 10:49:02 -07:00
Kate Lovett
e74fedcb90
Fix InputDecorator intrinsic height reporting (#55408) 2020-04-22 16:38:02 -07:00
Kate Lovett
5d5175b0b3
Skip Audit - Material Library (#54322) 2020-04-21 19:13:02 -07:00
Justin McCandless
f646e26e90
iOS Text Selection Menu Overflow (#54140)
Adds the ability for the iOS text selection menu to handle items that are too wide for the screen.
2020-04-14 09:49:16 -07:00
Alexandre Ardhuin
7ceed97302
replace simple empty Container with w & h with SizedBox (#54394)
* replace simple Container(w & h) with SizedBox

* address review comments

* address review comments
2020-04-10 22:32:40 +02:00
Justin McCandless
a811bce4b0
TextField behavior when at maxLength (#52130)
TextFields now disallow adding characters in the center of the text at maxLength.
2020-03-18 08:02:22 -07:00
Justin McCandless
4841a7ed6f
Text Selection Overflow (Android) (#49391)
Adds an overflow menu to the text selection menu on Android when the items overflow.
2020-03-11 13:36:10 -07:00
Per Classon
88852731a5
Validate text selection before updating it inside of EditableText (#51410) 2020-03-06 01:26:01 -08:00
Flutter GitHub Bot
b0381df11f
Unlooping Golden File Tests (#51883) 2020-03-04 15:21:01 -08:00
Greg Spencer
1ba4f1f509
Add Linux and Windows target platforms (#51519)
This PR adds the linux and windows target platform enum values, along with automatically setting the defaultTargetPlatform to the appropriate value on those platforms.

Fixes #31366
2020-03-03 04:38:04 -08:00
Jason Simmons
ae027c194f
Use strut box heights to calculate selection rectangles in order to ensure that they remain within visible bounds (#50354) 2020-02-28 09:36:03 -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
Alexandre Ardhuin
f15c887c63
change quote to avoid escapes (#50368) 2020-02-11 20:58:27 +01:00
Gary Qian
3e1a124e0e
Expose selectionHeightStyle and selectionWidthStyle on TextFields (#48917) 2020-02-05 17:38:03 -08:00
Dan Field
8b2993337a
revert #48985 (#49572) 2020-01-27 14:36:02 -08:00
Hans Muller
bc5c46438a Migrate TextTheme to 2018 APIs (#48547) 2020-01-24 19:03:01 -08:00
shihchanghsiungsonos
379c3f4652 Fix the issue of TextSelection could misbehave inside a Nested Overlay (#49257) 2020-01-22 10:54:22 -08:00
Anthony
b67d5ec6e9 [a11y] Make sure RenderFractionalTranslation updates its semantics after the translation field is set (#48985) 2020-01-17 15:13:01 -08:00
Justin McCandless
c61e55ad6b Selection menu not showing when selection is 0,0 (#49000) 2020-01-17 10:58:01 -08:00
Greg Spencer
3dbe90e1fd
Add TargetPlatform.macOS tests to the material library (#48996)
This contains the test changes for adding TargetPlatform.macOS, which was done in #43457.

The main goal of this PR is to enable tests in the material library that are currently running only on iOS to also run on macOS, but only for the tests where that makes sense. For instance, we don't run any of the haptic feedback tests on macOS.
2020-01-17 10:51:11 -08:00
Josh Burton
6852605c4f Adds floatLabelBehavior to InputDecoration (#46115) 2020-01-15 18:53:01 -08:00
Lau Ching Jun
ef398d9e87 Disable most screenshot tests for web until we understand the flakes. (#47554) 2019-12-20 18:43:01 -08:00
Dan Field
4ad8271bf5 Reland text state (#47464) 2019-12-19 13:43:02 -08:00
Lau Ching Jun
d51956a9ea
Revert "Call setEditingState when text changes. (#47177)" (#47397)
This reverts commit d4b49ce9fc.
2019-12-18 18:03:24 -08:00
Alex Vincent
f546aa7def Fix buildCounter returns a widget when set to return null. (#45749)
When buildCounter returns null it no longer produces a widget that takes up space.
2019-12-18 10:45:28 -08:00
Dan Field
d4b49ce9fc
Call setEditingState when text changes. (#47177) 2019-12-17 14:03:04 -08:00
Alexandre Ardhuin
dfbd585668 implicit-casts:false in flutter/test (#46245) 2019-12-16 15:03:02 -08:00
Justin McCandless
c06bf6503a
iOS smart quote/dash configuration (#44923)
smartDashesType and smartQuotesType params for text fields to control iOS's smart punctuation feature.
2019-12-13 17:42:35 -05:00
Lau Ching Jun
535526b03c
Enable web for some of the golden tests (#46820)
* Make golden test timeout longer, some tests are flaky if the timeout is too short

* Enable some golden tests for web
2019-12-12 10:36:41 -08:00
Ian Hickson
449f4a6673
License update (#45373)
* Update project.pbxproj files to say Flutter rather than Chromium

Also, the templates now have an empty organization so that we don't cause people to give their apps a Flutter copyright.

* Update the copyright notice checker to require a standard notice on all files

* Update copyrights on Dart files. (This was a mechanical commit.)

* Fix weird license headers on Dart files that deviate from our conventions; relicense Shrine.

Some were already marked "The Flutter Authors", not clear why. Their
dates have been normalized. Some were missing the blank line after the
license. Some were randomly different in trivial ways for no apparent
reason (e.g. missing the trailing period).

* Clean up the copyrights in non-Dart files. (Manual edits.)

Also, make sure templates don't have copyrights.

* Fix some more ORGANIZATIONNAMEs
2019-11-27 15:04:02 -08:00
Alexandre Ardhuin
fcb40a05bb
make some BuildContext methods generics (#44189)
* make BuildContext.{ancestorStateOfType,ancestorRenderObjectOfType,rootAncestorStateOfType} generic

* make BuildContext.inheritFromWidgetOfExactType generic

* make BuildContext.ancestorInheritedElementForWidgetOfExactType generic

* make BuildContext.ancestorWidgetOfExactType generic

* fix snippet

* bump scoped_model on temp version

* update names

* Revert "bump scoped_model on temp version"

This reverts commit d1fcbba028cdb07f44738d1652391692d1ea5ec0.

* address review comments

* fix ci

* address review comments

* repeat the deprecation notice

* fix uppercase

* use of recommanded deprecation syntax

* address review comment
2019-11-22 17:35:20 +01:00
Bartosz Wiśniewski
5c15b270b3 Remove duplicated expect from text field test (#45081) 2019-11-18 09:51:16 -08:00
Justin McCandless
924e48eeb9
Increase TextField's minimum height from 40 to 48 (#42449)
This is being done to match the Material spec. It will likely break many visual diff tests.
2019-11-01 12:36:15 -04:00
Albertus Angga Raharja
b31ca1aaca
Add more structure to errors (continuation of #34684) (#42640)
* Add structured errors in Animations, TabView, ChangeNotifier

* Add structured error on MaterialPageRoute, BoxBorder, DecorationImagePainter, TextSpan

* Add structured errors in Debug

* Fix test errors

* Add structured errors in Scaffold and Stepper

* Add structured errors in part of Rendering Layer

* Fix failing test due to FloatingPoint precision

* Fix failing tests due to precision error and not using final

* Fix failing test due to floating precision error with RegEx instead

* Add structured error in CustomLayout and increase test coverage

* Add structured error & its test in ListBody

* Add structured error in ProxyBox and increase test coverage

* Add structured error message in Viewport

* Fix styles and add more assertions on ErrorHint and DiagnosticProperty

* Add structured error in scheduler/binding and scheduler/ticker

Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>

* Add structured error in AssetBundle and TextInput

Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>

* Add structured errors in several widgets #1

Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>

* Remove unused import

Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>

* Add assertions on hint messages

Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>

* Fix catch spacing

Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>

* Add structured error in several widgets part 2 and increase code coverage

Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>

* Add structured error in flutter_test/widget_tester

* Fix floating precision accuracy by using RegExp

Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>

* Remove todo to add tests in Scaffold showBottomSheet

Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>

* Fix reviews by indenting lines and fixing the assertion orders

Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>

* Fix failing tests due to renaming class

Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>

* Try skipping the NetworkBundleTest

Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>

* Remove leading space in material/debug error hint

Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
2019-10-28 11:00:49 -07:00
Justin McCandless
109f25588d
No multiline password fields (#42470)
Use assertions to prevent multiline password fields from being created
2019-10-28 10:59:26 -07:00
Kate Lovett
7bc02037e3
Re-land Local & Pre-Submit Support for Skia Gold (#43371) 2019-10-25 15:05:21 -07:00
Kate Lovett
3a3939a7fa
Revert "Skia Gold Support for Local & PreSubmit Testing in package:flutter (#40710)" (#43227)
This reverts commit 8df0d6556d.
2019-10-21 17:31:54 -07:00
Kate Lovett
8df0d6556d
Skia Gold Support for Local & PreSubmit Testing in package:flutter (#40710) 2019-10-21 16:45:56 -07:00
Greg Spencer
a7aa66164e
Re-implement hardware keyboard text selection. (#42879)
This re-implements keyboard text selection so that it will work on platforms other than Android (e.g. macOS, Linux, etc.).

Also, fixed a number of bugs in editing selection via a hardware keyboard (unable to select backwards, incorrect conversion to ASCII when cutting to clipboard, lack of support for CTRL-SHIFT-ARROW word selection, etc.).

Did not address the keyboard locale issues that remain, or add platform specific switches for the bindings. All that will need some more design work before implementing them.

Related Issues
Fixes #31951
2019-10-17 15:11:44 -07:00
Greg Spencer
6b2cc85546
Disable arrow key focus navigation for text fields (#42533)
This disables the arrow key focus navigation for text fields. This was non-standard behavior for text fields, although it remains useful for other kinds of controls.

Fixes #42259
2019-10-14 18:50:05 -07:00
Rody Davis
b730a993c1 Fix CupertinoTextField and TextField ToolbarOptions not changing (#40665) 2019-10-04 11:22:57 -07:00
Alexandre Ardhuin
f0553ba58e
Missing trailing commas (#41473)
* add missing trailing commas

* add more missing trailing commas

* add more and more missing trailing commas
2019-09-30 18:48:23 +02: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 6ad88bd5c0.
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
Michael Goderbauer
9d70c85f5a
a11y improvements for textfield (#40390) 2019-09-13 09:23:27 -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
adazh
93c32c4ff6
Moved the default BinaryMessenger instance to ServicesBinding (#38464)
* Moved the default BinaryMessenger instance to ServicesBinding

This reverts commit 821602aef3.

* Added assertion in defaultBinaryMessenger. Also fixed the devicelab tests.
2019-08-21 16:47:42 -07:00
Michael Klimushyn
821602aef3
Revert "Moved the default BinaryMessenger instance to ServicesBinding (#37489)" (#37983)
This reverts commit 92ef2b9ce1.

This requires either runApp() or
WidgetsFlutterBinding.ensureInitialized() to have been called before
using any MethodChannels. Plugins broadly rely on MethodChannels and
right now there's no general requirements that they be constructed
within the runApp call, so the ecosystem breakages from this are broader
than originally thought. Reverting for now.
2019-08-09 16:30:30 -07:00
adazh
92ef2b9ce1
Moved the default BinaryMessenger instance to ServicesBinding (#37489) 2019-08-09 10:13:40 -07:00
Tong Mu
b11c5acaa6
Ensure that tests remove pointers by using addTearDown (#37524)
Guard removePointer with addTearDown to avoid cascading test crash.
2019-08-07 10:16:33 -07:00
Justin McCandless
5c48d90691
Multiline Selection Menu Position Bug (#36974)
Fix bug where selection menu appeared at top of screen for multiline inputs.
2019-08-02 15:40:11 -07:00
Justin McCandless
954714c967
Hide text selection handle after entering text (#37436)
The text caret wasn't being hidden after entering text, this fixes it.
2019-08-02 10:10:39 -07:00
chunhtai
eddcc6bb25
reland Enable selection by default for password text field and expose api to turn on and off context menu options (#37324) 2019-08-01 14:19:04 -07:00
Michael Goderbauer
9a01ed2a55
Revert "reland Enable selection by default for password text field and expose api to turn on and off context menu options (#34676) (#37183)" (#37295)
This reverts commit 7eb09a842e.
2019-07-31 15:34:22 +02:00
chunhtai
7eb09a842e
reland Enable selection by default for password text field and expose api to turn on and off context menu options (#34676) (#37183)
This reverts commit 48c7090f3c.
2019-07-30 14:19:10 -07:00
Kate Lovett
616794fca7
Re-land "Part 1: Skia Gold Testing" (#36103) 2019-07-28 12:26:06 -07:00
chunhtai
48c7090f3c
Revert "Enable selection by default for password text field and expose api to turn on and off context menu options (#34676)" (#37055)
This reverts commit 0d0af31598.
2019-07-26 18:25:52 -07:00
chunhtai
0d0af31598
Enable selection by default for password text field and expose api to turn on and off context menu options (#34676) 2019-07-26 10:03:30 -07:00
chunhtai
2338576aa6
implement selectable text (#34019) 2019-07-19 12:17:41 -07:00
Kate Lovett
8809f698cb
Revert "Part 1: Skia Gold Testing (#33688)" (#36094)
This reverts commit eb0b179028.
Skia Gold post-submit test were failing due to the service account not being found on Cirrus.
2019-07-12 13:35:36 -07:00
Kate Lovett
eb0b179028
Part 1: Skia Gold Testing (#33688)
* Fresh PR for Gold integration.

* Nits

* WIP

* Artifacts from merge

* Changed some platform dependencies for web, added library prefix notation for Skia Gold test names.

* Updating for CI implementation

* Write out service account

* Writing to skip out

* WIP

* ++

* Fixing depot tools deps

* Windows depot_tools

* Fixing setup scripts

* ++

* depot tools

* ++

* WIP

* Tracing depot_tools clone

* WIP

* ++

* analyzer

* WIP

* chrome typo

* copy artifact

* Working on tests

* Code cleanup

* ++

* Code cleanup, updated tests

* ++ review feedback

* Review

* Analyzer

* Review feedback

* Nits from review

* PRogress

* ++

* Fixing tests

* ++

* Testing repo route

* Just needing documention around new structures.

* cleanup

* Analyzer

* Documentation updates

* Documentation updates

* Cirrus updates

* cirrus nit

* Review feedback

* Review feedback

* Fixing skip comparator

* Fix base directory for Skia Gold case

* ++

* Feedback

* ++

* Fixed uri assertion

* Made GoldensClient abstract, altered SkiaGoldClient constructor

* Analyzer
2019-07-12 12:23:04 -07:00
Justin McCandless
ff53fbe194
Text selection menu show/hide cases (#35219)
Show and hide the text selection menu at the correct time with various gestures in the text field.
2019-07-10 14:08:14 -07:00
LongCatIsLooong
2602119194
Cupertino text edit tooltip rework (#34095) 2019-06-18 18:29:10 -07:00
Kate Lovett
7d95e8e0c1
Splitting golden file versioning out as an argument of matchesGoldenFile (#33880)
* Splitting golden file versioning out as an argument of matchesGoldenFile

* Fixing description implementation.

* Removing unused imports

* Removing unused import

* Review feedback
2019-06-18 11:32:13 -07:00
Jonah Williams
3ae6abd9e8
Compatibility pass on flutter/material tests for JavaScript compilation. (9) (#33378) 2019-06-12 17:06:01 -07:00
chunhtai
38a5bbb44e
fix empty selection arrow when double clicked on empty read only textfield in ios (#34068) 2019-06-10 09:19:41 -07:00
Justin McCandless
ce4f15cd69
Toggle toolbar exception fix (#34055)
Stop a text editing error from happening
2019-06-10 08:06:24 -07:00
Justin McCandless
a35d6615ee
Double double tap toggles instead of error (#33802)
Fix exception that was happening when double-double-tapping a TextField (or double long tapping).
2019-06-04 10:39:08 -07:00
Justin McCandless
fce54ae685
Handles hidden by keyboard (#32838)
Extra space when scrolling to selected input so that the selection caret is visible.
2019-06-04 08:37:29 -07:00
Kate Lovett
04015b987b
Fixing duplicate test names. (#33805) 2019-06-04 07:01:52 -07:00
chunhtai
730025fa17
fix issue 14014 read only text field (#32059) 2019-06-03 14:00:43 -07:00
Jonah Williams
6619ab8fea
Add web safe indirection to Platform.isPlatform getters (2) (#33780) 2019-06-03 13:16:14 -07:00
Jonah Williams
cd1d40a7c9
Revert "Add web safe indirection to Platform.isPlatform getters (#33406)" (#33776)
This reverts commit d92b3b40d2.
2019-06-03 11:08:30 -07:00
Jonah Williams
d92b3b40d2
Add web safe indirection to Platform.isPlatform getters (#33406) 2019-06-03 10:55:36 -07:00
Justin McCandless
d963e4fe35
Text selection handles are sometimes not interactive (#31852)
The text selection handles now feel a lot more responsive, and their implementation was cleaned up a bit.
2019-05-30 12:31:18 -07:00
Tong Mu
fa3fbc89a3
Material allows "select all" when not collapsed (#32950)
This PR enables "Select all" on MaterialTextSelection when text is partially selected.
2019-05-30 10:03:31 -07:00
Harry Terkelsen
13e9bfcc94
Add binaryMessenger constructor argument to platform channels (#30406)
* Deprecates `BinaryMessages` in favor of a default instance of `BinaryMessenger`, called `defaultBinaryMessenger`
* Platform channels use the `defaultBinaryMessenger` for their binaryMessenger default argument.
2019-05-28 11:18:22 -07:00
Justin McCandless
6031c56d4c
Material Long Press Text Handle Flash (#32911)
Fix a bug where holding down on text selection caused the handles to flash. The fix was to only update selection when it actually changed.
2019-05-23 08:15:59 -07:00
chunhtai
3f92640521
Visual selection is not adjusted when changing text selection with TalkBack (#32832) 2019-05-16 14:41:39 -07:00
Greg Spencer
bb3c660522
Implements focus handling and hover for Material buttons. (#31438)
This implements focus and hover handling for Material buttons. It inserts Focus widgets into the tree in order to allow buttons to be focusable via keyboard traversal (a.k.a. TAB traversal), and Listener widgets into the InkWell to allow the detection of hover states for widgets.

Addresses #11344, #1608, and #13264.
2019-05-14 20:48:29 -07:00
Mouad Debbar
bcae3563d4
Redo: Show/hide toolbar and handles based on device kind (#32704) 2019-05-14 11:04:16 -07:00
Mouad Debbar
ef5abcc6bf
Revert "Show/hide toolbar and handles based on device kind (#29683)" (#32702)
This reverts commit 18ca37542d.
2019-05-14 09:33:04 -07:00
Mouad Debbar
18ca37542d
Show/hide toolbar and handles based on device kind (#29683) 2019-05-14 08:50:23 -07:00
Greg Spencer
a5053bfb29
Fix transforms for things with RenderPointerListeners (#32535)
This fixes #32525, because it now marks the compositing bits as needing to be recalculated if the mouse tracker changes its idea of whether or not a mouse is attached.

This bug occurred because the test framework was leaking state from one test to the next (the state about whether a mouse pointer was active), and so even though there was a "passing" test when run in order with the other tests in the file, when the test was run individually (or first), it would have failed and caught the bug.

This adds an assert to make sure that after each test there are no simulated mouse pointers connected, and now calls removePointer in all of the tests where this was a problem.
2019-05-13 15:48:12 -07:00
Greg Spencer
d2fe08628d
Implements FocusTraversalPolicy and DefaultFocusTraversal features. (#30076)
This implements a DefaultFocusTraversal widget to describe the focus traversal policy for its children, defined by a FocusTraversalPolicy object from which custom policies may be created. Pre-defined policies include widget-order traversal, "reading order" traversal and directional traversal.
2019-05-09 20:24:23 -07:00
Michael Goderbauer
1621baafc7
Introduce separate HitTestResults for Box and Sliver (#31894) 2019-05-09 10:00:01 +02:00
chunhtai
21efdff8a5
fix issue 32212 Text field keyboard selection crashes (#32256) 2019-05-07 15:07:11 -07:00
yaheng
57d6666462 Fix text selection toolbar appearing under obstructions (#29809) 2019-05-06 11:18:09 -07:00
Gary Qian
4102486d63
Center iOS caret, remove constant offsets that do not scale (#31687) 2019-04-30 17:41:01 -07:00
liyuqian
71a89a469a
Reland "Fix text field selection toolbar under Opacity (#31097)" (#31802)
This reverts commit 120a1fc47f.

Updated the golden file
2019-04-30 09:47:32 -07:00
Jonah Williams
120a1fc47f
Revert "Fix text field selection toolbar under Opacity (#31097)" (#31800) 2019-04-29 12:57:35 -07:00
liyuqian
e427c2dd86
Fix text field selection toolbar under Opacity (#31097)
## Description

As we've introduced offset to the Opacity layer, we have to override
`applyTransform` to make Leader/FollowerLayer work correctly.

## Related Issues

Fixes https://github.com/flutter/flutter/issues/30587

Together with https://github.com/flutter/engine/pull/8585,
this test will also exercise test against
https://github.com/flutter/flutter/issues/30586.

## Tests

I added the following tests:
* text field selection toolbar renders correctly inside opacity
2019-04-29 11:25:41 -07:00
Greg Spencer
7775c23784
[Re-Land] Implement focus traversal for desktop platforms. (#31614)
This re-lands the Focus changes in #30040. Correctness changes in routes.dart, and removes the automatic requesting of focus on reparent when there is no current focus, which caused undesirable selections.

Addresses #11344, #1608, #13264, and #1678
Fixes #30084
Fixes #26704
2019-04-25 16:26:58 -07:00
Justin McCandless
a21a1f4105
iOS selection handles are invisible (#31332)
Fix a bug where text selection handles were invisible in iOS
2019-04-25 12:32:10 -07:00
Greg Spencer
590cc27b31
Revert "Implement focus traversal for desktop platforms, shoehorn edition. (#30040)" (#31461)
This reverts commit 4218c0bc38.
2019-04-22 18:02:35 -07:00
Greg Spencer
4218c0bc38
Implement focus traversal for desktop platforms, shoehorn edition. (#30040)
Implements focus traversal for desktop platforms, including re-implementing the existing focus manager and focus tree.

This implements a Focus widget that can be put into a widget tree to allow input focus to be given to a particular part of a widget tree.

It incorporates with the existing FocusScope and FocusNode infrastructure, and has minimal breakage to the API, although FocusScope.reparentIfNeeded is removed, replaced by a call to FocusAttachment.reparent(), so this is a breaking change:

FocusScopeNodes must now be attached to the focus tree using FocusScopeNode.attach, which takes a context and an optional onKey callback, and returns a FocusAttachment that should be kept by the widget that hosts the FocusScopeNode. This is necessary because of the need to make sure that the focus tree reflects the widget hierarchy.

Callers that used to call FocusScope(context).reparentIfNeeded in their build method will call reparent  on a FocusAttachment instead, which they will obtain by calling FocusScopeNode.attach in their initState method. Widgets that own FocusNodes will need to call dispose on the focus node in their dispose method.

Addresses #11344, #1608, #13264, and #1678
Fixes #30084
Fixes #26704
2019-04-22 09:51:40 -07:00
Justin McCandless
6e1b143fed
Text field scroll physics (#31088)
TextField and CupertinoTextField can now specify scrollPhysics. Cupertino defaults to bouncing now.
2019-04-22 07:42:59 -07:00
Justin McCandless
ed91a3be49
Fix cursor outside of input width (#30525)
* Disallow cursor from appearing beyond the width of the input.

* Test that verifies the cursor can't exceed the width of the input

* Use constant from editable.dart to explain 1 pixel difference in test

* Fix failing test that tested the case of overflowing spaces
2019-04-10 10:35:03 -05:00
Jonah Williams
3c93b65a9b
Update to latest matcher (#30019) 2019-03-27 17:21:10 -07:00
Mouad Debbar
c80366a160
Avoid flickering while dragging to select text (#29563) 2019-03-21 13:25:29 -07:00
Alexandre Ardhuin
a6af422874
some spaces formatting (#29452)
* some space formattings

* always use blocks in if-else if a block is used

* format spaces in for and while

* allow multiline if conditions

* fix missing space
2019-03-20 23:23:31 +01:00
Mouad Debbar
5787fc3ae2
Fix text selection when user is dragging in the opposite direction (#29395) 2019-03-15 13:09:27 -07:00
Justin McCandless
6d8f539971
Text field height attempt 2 (#29250)
Adds the `minLines` and `expands` parameters for controlling text height.  The original PR was reverted, so this one contains a few extra fixes for the tests that were broken.
2019-03-14 18:01:11 -07:00
Todd Volkert
f21497ee8c
Revert "Fix TextField height issues (#27205)" (#29093)
This reverts commit 9e9f48dabb.
2019-03-09 01:17:58 -08:00
Alexandre Ardhuin
a0d1f93b07
fix block formatting (#29051) 2019-03-09 09:03:11 +01:00
Justin McCandless
9e9f48dabb
Fix TextField height issues (#27205)
* Create new TextField attribute to control maxLength behaviour

* Create test case for maxLinesIncrementalHeight

* fix maxLinesIncrementalHeight set method

* fix editable_test.dart

* Just introducing some proposed API additions, renaming to expands

* Pass minLines and expands through to child widgets and validate

* minLines can't be null, and expands can't be true when maxLines is 1

* Implement minLines and maxLines height sizing logic

* Simplify minLines validation logic

* expands parameter proof of concept

* min/max mixup bug fix, and tests work with expands false

* Test expands=true cases, and fix textPainter.height being out of date

* Test all behavior matrix cases

* min/max assertion more strict, can't be equal

* Tests work that were missing expands serialization

* Action sheet tests no longer fail due to rounding error

* TextFieldFocus test no longer mysteriously fails

* TODOs for making expands nullable. Will depend on how Expanded wrapping works

* Expanded growth happens when expanded is true and maxLines is null

* Test Expanded wrapper

* No more overflow when wrapped in Expanded

* Docs improvements

* expands can be null

* Simplify error cases to support existing behavior

* Docs examples and other docs cleanup

* Expansion up to perfectly meet the parent size

* Fix analyze null error

* Fix test after move to nullable expands

* minLines defaults to null

* expands is now exclusively for expanding to parent height and not growth between min and max

* _layout rewritten to handle max height. Need to fix prefix tests and
reenable expands

* Tests for textfield overflowing parent

* layoutLineBox is documented and private

* expands works in new _layout

* _layout return numbers seem to perfectly match original _layout

* inputWidth comment after trying it out and failing tests

* Fix analyze errors

* WIP prefix/suffix do affect height

* Prefix/suffix and icons affect height, tests pass, but I'm still visually verifying identical to original

* Tall prefix test that verifies pixel perfect layout

* Fix overflowing edge case and test it

* Clean up comments, old code, and todos

* Changing _expands causes relayout. Wasnt able to figure out how to test though...

* Clean up code review comments

* Fix misalignment when tall prefix and border, and clean up related test

* Simple code review cleanup

* Bring back inputWidth to _layout method

* Fix rounding errors showing up in mac tests

* Fix flake by reordering tests. Without this, the dreaded intrinsicwidth flake is reproducible 50% of the time on my machine.

* Fix more rounding error mac tests
2019-03-08 12:22:43 -08:00
Alexandre Ardhuin
440ce8fde6
Fix indentations of statements in BlockFunctionBody (#28933)
* fix indentof statements in BlockFunctionBody

* fix indentof statements in BlockFunctionBody in tests
2019-03-07 21:09:28 +01:00
Mouad Debbar
b94bf87c70
Text selection via mouse (#28290) 2019-03-01 13:57:10 -08:00
Alexandre Ardhuin
387f885481
Add missing trailing commas (#28673)
* add trailing commas on list/map/parameters

* add trailing commas on Invocation with nb of arg>1

* add commas for widget containing widgets

* add trailing commas if instantiation contains trailing comma

* revert bad change
2019-03-01 08:17:55 +01:00
xster
b09e64e142
Support iOS devices reporting pressure data of 0 (#28478) 2019-02-26 14:16:25 -08:00
xster
ec00e974d0
Add long-press-move support for text fields 2 (#28242) 2019-02-25 14:34:54 -08:00
Gary Qian
7b5a769b31
Force line height in TextFields with strut (#27612) 2019-02-23 03:35:37 -08:00
Alexandre Ardhuin
5169ab5974
format parameter list (#27261) 2019-02-21 09:27:07 +01:00