@@ -1610,9 +1610,9 @@ void main() {
16101610 await tester.pump();
16111611
16121612 final double inputWidth = findRenderEditable(tester).size.width;
1613- final Offset cursorOffsetSpaces = findRenderEditable(
1614- tester,
1615- ).getLocalRectForCaret(const TextPosition(offset: testValueSpaces.length)) .bottomRight;
1613+ final Offset cursorOffsetSpaces = findRenderEditable(tester)
1614+ .getLocalRectForCaret(const TextPosition(offset: testValueSpaces.length))
1615+ .bottomRight;
16161616
16171617 expect(cursorOffsetSpaces.dx, inputWidth - kCaretGap);
16181618 });
@@ -1634,9 +1634,9 @@ void main() {
16341634 await tester.tapAt(textOffsetToPosition(tester, testValueSpaces.length));
16351635 await tester.pump();
16361636
1637- final Offset cursorOffsetSpaces = findRenderEditable(
1638- tester,
1639- ).getLocalRectForCaret(const TextPosition(offset: testValueSpaces.length)) .topLeft;
1637+ final Offset cursorOffsetSpaces = findRenderEditable(tester)
1638+ .getLocalRectForCaret(const TextPosition(offset: testValueSpaces.length))
1639+ .topLeft;
16401640
16411641 expect(cursorOffsetSpaces.dx >= 0, isTrue);
16421642 });
@@ -10237,8 +10237,7 @@ void main() {
1023710237
1023810238 testWidgets('Tapping on a collapsed selection toggles the toolbar', (WidgetTester tester) async {
1023910239 final TextEditingController controller = _textEditingController(
10240- text:
10241- 'Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neigse Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges',
10240+ text: 'Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neigse Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges',
1024210241 );
1024310242 // On iOS/iPadOS, during a tap we select the edge of the word closest to the tap.
1024410243 await tester.pumpWidget(
@@ -10319,68 +10318,65 @@ void main() {
1031910318 expectNoCupertinoToolbar();
1032010319 }, variant: const TargetPlatformVariant(<TargetPlatform>{TargetPlatform.iOS}));
1032110320
10322- testWidgets('Tapping on a non-collapsed selection toggles the toolbar and retains the selection', (
10323- WidgetTester tester,
10324- ) async {
10325- final TextEditingController controller = _textEditingController(
10326- text: 'Atwater Peel Sherbrooke Bonaventure',
10327- );
10328- // On iOS/iPadOS, during a tap we select the edge of the word closest to the tap.
10329- await tester.pumpWidget(
10330- MaterialApp(
10331- home: Material(
10332- child: Center(child: TextField(controller: controller)),
10321+ testWidgets(
10322+ 'Tapping on a non-collapsed selection toggles the toolbar and retains the selection',
10323+ (WidgetTester tester) async {
10324+ final TextEditingController controller = _textEditingController(
10325+ text: 'Atwater Peel Sherbrooke Bonaventure',
10326+ );
10327+ // On iOS/iPadOS, during a tap we select the edge of the word closest to the tap.
10328+ await tester.pumpWidget(
10329+ MaterialApp(
10330+ home: Material(
10331+ child: Center(child: TextField(controller: controller)),
10332+ ),
1033310333 ),
10334- ),
10335- );
10334+ );
1033610335
10337- final Offset vPos = textOffsetToPosition(tester, 29); // Index of 'Bonav|enture'.
10338- final Offset ePos =
10339- textOffsetToPosition(tester, 35) +
10340- const Offset(
10341- 7.0,
10342- 0.0,
10343- ); // Index of 'Bonaventure|' + Offset(7.0,0), which taps slightly to the right of the end of the text.
10344- final Offset wPos = textOffsetToPosition(tester, 3); // Index of 'Atw|ater'.
10336+ final Offset vPos = textOffsetToPosition(tester, 29); // Index of 'Bonav|enture'.
10337+ final Offset ePos = textOffsetToPosition(tester, 35) + const Offset(7.0, 0.0); // Index of 'Bonaventure|' + Offset(7.0,0), which taps slightly to the right of the end of the text.
10338+ final Offset wPos = textOffsetToPosition(tester, 3); // Index of 'Atw|ater'.
1034510339
10346- // This tap just puts the cursor somewhere different than where the double
10347- // tap will occur to test that the double tap moves the existing cursor first.
10348- await tester.tapAt(wPos);
10349- await tester.pump(const Duration(milliseconds: 500));
10340+ // This tap just puts the cursor somewhere different than where the double
10341+ // tap will occur to test that the double tap moves the existing cursor first.
10342+ await tester.tapAt(wPos);
10343+ await tester.pump(const Duration(milliseconds: 500));
1035010344
10351- await tester.tapAt(vPos);
10352- await tester.pump(const Duration(milliseconds: 50));
10353- // First tap moved the cursor.
10354- expect(controller.selection.isCollapsed, true);
10355- expect(controller.selection.baseOffset, 35);
10356- await tester.tapAt(vPos);
10357- await tester.pumpAndSettle(const Duration(milliseconds: 500));
10345+ await tester.tapAt(vPos);
10346+ await tester.pump(const Duration(milliseconds: 50));
10347+ // First tap moved the cursor.
10348+ expect(controller.selection.isCollapsed, true);
10349+ expect(controller.selection.baseOffset, 35);
10350+ await tester.tapAt(vPos);
10351+ await tester.pumpAndSettle(const Duration(milliseconds: 500));
1035810352
10359- // Second tap selects the word around the cursor.
10360- expect(controller.selection, const TextSelection(baseOffset: 24, extentOffset: 35));
10353+ // Second tap selects the word around the cursor.
10354+ expect(controller.selection, const TextSelection(baseOffset: 24, extentOffset: 35));
1036110355
10362- // The toolbar shows up.
10363- expectCupertinoToolbarForPartialSelection();
10356+ // The toolbar shows up.
10357+ expectCupertinoToolbarForPartialSelection();
1036410358
10365- // Tap the selected word to hide the toolbar and retain the selection.
10366- await tester.tapAt(vPos);
10367- await tester.pumpAndSettle();
10368- expect(controller.selection, const TextSelection(baseOffset: 24, extentOffset: 35));
10369- expectNoCupertinoToolbar();
10359+ // Tap the selected word to hide the toolbar and retain the selection.
10360+ await tester.tapAt(vPos);
10361+ await tester.pumpAndSettle();
10362+ expect(controller.selection, const TextSelection(baseOffset: 24, extentOffset: 35));
10363+ expectNoCupertinoToolbar();
1037010364
10371- // Tap the selected word to show the toolbar and retain the selection.
10372- await tester.tapAt(vPos);
10373- await tester.pumpAndSettle();
10374- expect(controller.selection, const TextSelection(baseOffset: 24, extentOffset: 35));
10375- expectCupertinoToolbarForPartialSelection();
10365+ // Tap the selected word to show the toolbar and retain the selection.
10366+ await tester.tapAt(vPos);
10367+ await tester.pumpAndSettle();
10368+ expect(controller.selection, const TextSelection(baseOffset: 24, extentOffset: 35));
10369+ expectCupertinoToolbarForPartialSelection();
1037610370
10377- // Tap past the selected word to move the cursor and hide the toolbar.
10378- await tester.tapAt(ePos);
10379- await tester.pumpAndSettle();
10380- expect(controller.selection.isCollapsed, true);
10381- expect(controller.selection.baseOffset, 35);
10382- expectNoCupertinoToolbar();
10383- }, variant: const TargetPlatformVariant(<TargetPlatform>{TargetPlatform.iOS}));
10371+ // Tap past the selected word to move the cursor and hide the toolbar.
10372+ await tester.tapAt(ePos);
10373+ await tester.pumpAndSettle();
10374+ expect(controller.selection.isCollapsed, true);
10375+ expect(controller.selection.baseOffset, 35);
10376+ expectNoCupertinoToolbar();
10377+ },
10378+ variant: const TargetPlatformVariant(<TargetPlatform>{TargetPlatform.iOS}),
10379+ );
1038410380
1038510381 testWidgets('double tap selects word and first tap of double tap moves cursor (iOS)', (
1038610382 WidgetTester tester,
@@ -13223,8 +13219,7 @@ void main() {
1322313219 'long press drag can edge scroll vertically',
1322413220 (WidgetTester tester) async {
1322513221 final TextEditingController controller = _textEditingController(
13226- text:
13227- 'Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neigse Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges',
13222+ text: 'Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neigse Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges',
1322813223 );
1322913224 await tester.pumpWidget(
1323013225 MaterialApp(
@@ -13299,8 +13294,7 @@ void main() {
1329913294 'keyboard selection change scrolls the field vertically',
1330013295 (WidgetTester tester) async {
1330113296 final TextEditingController controller = _textEditingController(
13302- text:
13303- 'Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges',
13297+ text: 'Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges',
1330413298 );
1330513299 await tester.pumpWidget(
1330613300 MaterialApp(
@@ -13361,8 +13355,7 @@ void main() {
1336113355
1336213356 testWidgets('mouse click and drag can edge scroll vertically', (WidgetTester tester) async {
1336313357 final TextEditingController controller = _textEditingController(
13364- text:
13365- 'Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges',
13358+ text: 'Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges Atwater Peel Sherbrooke Bonaventure Angrignon Peel Côte-des-Neiges',
1336613359 );
1336713360 await tester.pumpWidget(
1336813361 MaterialApp(
@@ -15123,13 +15116,12 @@ void main() {
1512315116 TextField(
1512415117 key: textField2Key,
1512515118 maxLength: 1,
15126- buildCounter:
15127- (
15128- BuildContext context, {
15129- required int currentLength,
15130- required bool isFocused,
15131- int? maxLength,
15132- }) => null,
15119+ buildCounter: (
15120+ BuildContext context, {
15121+ required int currentLength,
15122+ required bool isFocused,
15123+ int? maxLength,
15124+ }) => null,
1513315125 ),
1513415126 ],
1513515127 ),
@@ -17302,12 +17294,11 @@ void main() {
1730217294 final Widget customMagnifier = Container(key: UniqueKey());
1730317295 final textField = TextField(
1730417296 magnifierConfiguration: TextMagnifierConfiguration(
17305- magnifierBuilder:
17306- (
17307- BuildContext context,
17308- MagnifierController controller,
17309- ValueNotifier<MagnifierInfo>? info,
17310- ) => customMagnifier,
17297+ magnifierBuilder: (
17298+ BuildContext context,
17299+ MagnifierController controller,
17300+ ValueNotifier<MagnifierInfo>? info,
17301+ ) => customMagnifier,
1731117302 ),
1731217303 );
1731317304
@@ -19347,8 +19338,10 @@ class _ObscureTextTestWidgetState extends State<_ObscureTextTestWidget> {
1934719338 }
1934819339}
1934919340
19350- typedef FormatEditUpdateCallback =
19351- void Function(TextEditingValue oldValue, TextEditingValue newValue);
19341+ typedef FormatEditUpdateCallback = void Function(
19342+ TextEditingValue oldValue,
19343+ TextEditingValue newValue,
19344+ );
1935219345
1935319346// On web, key events in text fields are handled by the browser.
1935419347const bool areKeyEventsHandledByPlatform = isBrowser;
0 commit comments