diff --git a/dev/integration_tests/flutter_gallery/test/demo/material/chip_demo_test.dart b/dev/integration_tests/flutter_gallery/test/demo/material/chip_demo_test.dart index 1b11c4d833ca..9d769f7337fd 100644 --- a/dev/integration_tests/flutter_gallery/test/demo/material/chip_demo_test.dart +++ b/dev/integration_tests/flutter_gallery/test/demo/material/chip_demo_test.dart @@ -20,7 +20,6 @@ void main() { isEnabled: true, isFocusable: true, hasTapAction: true, - hasFocusAction: true, label: 'Update border shape', )); @@ -30,7 +29,6 @@ void main() { isEnabled: true, isFocusable: true, hasTapAction: true, - hasFocusAction: true, label: 'Reset chips', )); diff --git a/packages/flutter/lib/src/widgets/focus_scope.dart b/packages/flutter/lib/src/widgets/focus_scope.dart index 7b9743bb9662..acd9b04f1bfd 100644 --- a/packages/flutter/lib/src/widgets/focus_scope.dart +++ b/packages/flutter/lib/src/widgets/focus_scope.dart @@ -671,14 +671,6 @@ class _FocusState extends State { Widget child = widget.child; if (widget.includeSemantics) { child = Semantics( - // Automatically request the focus for a focusable widget when it - // receives an input focus action from the semantics. Nothing is needed - // for losing the focus because if focus is lost, that means another - // node will gain focus and take focus from this widget. - onFocus: - _couldRequestFocus - ? focusNode.requestFocus - : null, focusable: _couldRequestFocus, focused: _hadPrimaryFocus, child: widget.child, diff --git a/packages/flutter/test/cupertino/checkbox_test.dart b/packages/flutter/test/cupertino/checkbox_test.dart index b6bdaf6baf25..601aef991d88 100644 --- a/packages/flutter/test/cupertino/checkbox_test.dart +++ b/packages/flutter/test/cupertino/checkbox_test.dart @@ -34,7 +34,6 @@ void main() { hasEnabledState: true, isEnabled: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); @@ -55,7 +54,6 @@ void main() { isChecked: true, isEnabled: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); @@ -75,7 +73,6 @@ void main() { hasEnabledState: true, // isFocusable is delayed by 1 frame. isFocusable: true, - hasFocusAction: true, )); await tester.pump(); @@ -181,7 +178,6 @@ void main() { hasEnabledState: true, isEnabled: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); handle.dispose(); @@ -251,7 +247,7 @@ void main() { SemanticsFlag.isFocusable, SemanticsFlag.isCheckStateMixed, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], ), hasLength(1)); await tester.pumpWidget( @@ -272,7 +268,7 @@ void main() { SemanticsFlag.isChecked, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], ), hasLength(1)); await tester.pumpWidget( @@ -292,7 +288,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], ), hasLength(1)); semantics.dispose(); diff --git a/packages/flutter/test/cupertino/radio_test.dart b/packages/flutter/test/cupertino/radio_test.dart index 9f7c3f2cee90..c1eb4e6b52e7 100644 --- a/packages/flutter/test/cupertino/radio_test.dart +++ b/packages/flutter/test/cupertino/radio_test.dart @@ -147,7 +147,6 @@ void main() { ], actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], ), ); @@ -172,7 +171,6 @@ void main() { hasEnabledState: true, isEnabled: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, isInMutuallyExclusiveGroup: true, )); @@ -192,7 +190,6 @@ void main() { hasEnabledState: true, isEnabled: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, isInMutuallyExclusiveGroup: true, isChecked: true, @@ -213,7 +210,6 @@ void main() { hasEnabledState: true, isFocusable: true, isInMutuallyExclusiveGroup: true, - hasFocusAction: true, )); await tester.pump(); diff --git a/packages/flutter/test/cupertino/route_test.dart b/packages/flutter/test/cupertino/route_test.dart index 649efb25a55a..2ca816975ef5 100644 --- a/packages/flutter/test/cupertino/route_test.dart +++ b/packages/flutter/test/cupertino/route_test.dart @@ -1945,7 +1945,7 @@ void main() { await tester.pumpAndSettle(); expect(semantics, isNot(includesNodeWith( - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: 'Dismiss', ))); debugDefaultTargetPlatformOverride = null; diff --git a/packages/flutter/test/cupertino/text_field_test.dart b/packages/flutter/test/cupertino/text_field_test.dart index 7407eccea10a..c46651ab159f 100644 --- a/packages/flutter/test/cupertino/text_field_test.dart +++ b/packages/flutter/test/cupertino/text_field_test.dart @@ -2621,7 +2621,7 @@ void main() { ), ); - expect(semantics, isNot(includesNodeWith(actions: [SemanticsAction.tap, SemanticsAction.focus]))); + expect(semantics, isNot(includesNodeWith(actions: [SemanticsAction.tap]))); semantics.dispose(); }); diff --git a/packages/flutter/test/material/back_button_test.dart b/packages/flutter/test/material/back_button_test.dart index 682dc4b2325d..afdba078a123 100644 --- a/packages/flutter/test/material/back_button_test.dart +++ b/packages/flutter/test/material/back_button_test.dart @@ -215,7 +215,6 @@ void main() { hasEnabledState: true, isEnabled: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); handle.dispose(); @@ -259,7 +258,6 @@ void main() { hasEnabledState: true, isEnabled: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); handle.dispose(); diff --git a/packages/flutter/test/material/bottom_navigation_bar_test.dart b/packages/flutter/test/material/bottom_navigation_bar_test.dart index f0e65837bb76..c74f893e6e71 100644 --- a/packages/flutter/test/material/bottom_navigation_bar_test.dart +++ b/packages/flutter/test/material/bottom_navigation_bar_test.dart @@ -2111,7 +2111,6 @@ void main() { isFocusable: true, isSelected: true, hasTapAction: true, - hasFocusAction: true, ), ); expect( @@ -2121,7 +2120,6 @@ void main() { textDirection: TextDirection.ltr, isFocusable: true, hasTapAction: true, - hasFocusAction: true, ), ); expect( @@ -2131,7 +2129,6 @@ void main() { textDirection: TextDirection.ltr, isFocusable: true, hasTapAction: true, - hasFocusAction: true, ), ); }); @@ -2168,7 +2165,6 @@ void main() { isFocusable: true, isSelected: true, hasTapAction: true, - hasFocusAction: true, ), ); expect( @@ -2178,7 +2174,6 @@ void main() { textDirection: TextDirection.ltr, isFocusable: true, hasTapAction: true, - hasFocusAction: true, ), ); expect( @@ -2188,7 +2183,6 @@ void main() { textDirection: TextDirection.ltr, isFocusable: true, hasTapAction: true, - hasFocusAction: true, ), ); }); @@ -2521,7 +2515,6 @@ void main() { isFocusable: true, isSelected: true, hasTapAction: true, - hasFocusAction: true, ), ); expect( @@ -2531,7 +2524,6 @@ void main() { textDirection: TextDirection.ltr, isFocusable: true, hasTapAction: true, - hasFocusAction: true, ), ); }); @@ -2566,7 +2558,6 @@ void main() { isFocusable: true, isSelected: true, hasTapAction: true, - hasFocusAction: true, ), ); expect( @@ -2576,7 +2567,6 @@ void main() { textDirection: TextDirection.ltr, isFocusable: true, hasTapAction: true, - hasFocusAction: true, ), ); }); @@ -2757,13 +2747,13 @@ void main() { SemanticsFlag.isSelected, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: 'A\nTab 1 of 2', textDirection: TextDirection.ltr, ), TestSemantics( flags: [SemanticsFlag.isFocusable], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: 'B\nTab 2 of 2', textDirection: TextDirection.ltr, ), diff --git a/packages/flutter/test/material/calendar_date_picker_test.dart b/packages/flutter/test/material/calendar_date_picker_test.dart index b6eb7c577acf..ed7c1aa20541 100644 --- a/packages/flutter/test/material/calendar_date_picker_test.dart +++ b/packages/flutter/test/material/calendar_date_picker_test.dart @@ -864,7 +864,6 @@ void main() { tooltip: 'Previous month', isButton: true, hasTapAction: true, - hasFocusAction: true, isEnabled: true, hasEnabledState: true, isFocusable: true, @@ -873,7 +872,6 @@ void main() { tooltip: 'Next month', isButton: true, hasTapAction: true, - hasFocusAction: true, isEnabled: true, hasEnabledState: true, isFocusable: true, @@ -884,105 +882,90 @@ void main() { label: '1, Friday, January 1, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('2')), matchesSemantics( label: '2, Saturday, January 2, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('3')), matchesSemantics( label: '3, Sunday, January 3, 2016, Today', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('4')), matchesSemantics( label: '4, Monday, January 4, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('5')), matchesSemantics( label: '5, Tuesday, January 5, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('6')), matchesSemantics( label: '6, Wednesday, January 6, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('7')), matchesSemantics( label: '7, Thursday, January 7, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('8')), matchesSemantics( label: '8, Friday, January 8, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('9')), matchesSemantics( label: '9, Saturday, January 9, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('10')), matchesSemantics( label: '10, Sunday, January 10, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('11')), matchesSemantics( label: '11, Monday, January 11, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('12')), matchesSemantics( label: '12, Tuesday, January 12, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('13')), matchesSemantics( label: '13, Wednesday, January 13, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('14')), matchesSemantics( label: '14, Thursday, January 14, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('15')), matchesSemantics( label: '15, Friday, January 15, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isSelected: true, isFocusable: true, )); @@ -990,105 +973,90 @@ void main() { label: '16, Saturday, January 16, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('17')), matchesSemantics( label: '17, Sunday, January 17, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('18')), matchesSemantics( label: '18, Monday, January 18, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('19')), matchesSemantics( label: '19, Tuesday, January 19, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('20')), matchesSemantics( label: '20, Wednesday, January 20, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('21')), matchesSemantics( label: '21, Thursday, January 21, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('22')), matchesSemantics( label: '22, Friday, January 22, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('23')), matchesSemantics( label: '23, Saturday, January 23, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('24')), matchesSemantics( label: '24, Sunday, January 24, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('25')), matchesSemantics( label: '25, Monday, January 25, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('26')), matchesSemantics( label: '26, Tuesday, January 26, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('27')), matchesSemantics( label: '27, Wednesday, January 27, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('28')), matchesSemantics( label: '28, Thursday, January 28, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('29')), matchesSemantics( label: '29, Friday, January 29, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); expect(tester.getSemantics(find.text('30')), matchesSemantics( label: '30, Saturday, January 30, 2016', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); semantics.dispose(); @@ -1113,7 +1081,6 @@ void main() { expect(tester.getSemantics(find.text('$year')), matchesSemantics( label: '$year', hasTapAction: true, - hasFocusAction: true, isSelected: year == 2016, isFocusable: true, isButton: true, diff --git a/packages/flutter/test/material/card_test.dart b/packages/flutter/test/material/card_test.dart index 5e9003a1bf57..c8a5815e4414 100644 --- a/packages/flutter/test/material/card_test.dart +++ b/packages/flutter/test/material/card_test.dart @@ -130,7 +130,6 @@ void main() { textDirection: TextDirection.ltr, actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], flags: [ SemanticsFlag.hasEnabledState, diff --git a/packages/flutter/test/material/checkbox_list_tile_test.dart b/packages/flutter/test/material/checkbox_list_tile_test.dart index 81acbc9a6056..b91628a16c17 100644 --- a/packages/flutter/test/material/checkbox_list_tile_test.dart +++ b/packages/flutter/test/material/checkbox_list_tile_test.dart @@ -1189,7 +1189,6 @@ void main() { hasEnabledState: true, isEnabled: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, label: 'Hello\nthere', )); diff --git a/packages/flutter/test/material/checkbox_test.dart b/packages/flutter/test/material/checkbox_test.dart index 56cbf37d9772..636456d96202 100644 --- a/packages/flutter/test/material/checkbox_test.dart +++ b/packages/flutter/test/material/checkbox_test.dart @@ -78,7 +78,6 @@ void main() { hasEnabledState: true, isEnabled: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); @@ -98,7 +97,6 @@ void main() { isChecked: true, isEnabled: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); @@ -117,7 +115,6 @@ void main() { hasEnabledState: true, // isFocusable is delayed by 1 frame. isFocusable: true, - hasFocusAction: true, )); await tester.pump(); @@ -216,7 +213,6 @@ void main() { isChecked: true, isEnabled: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); handle.dispose(); @@ -246,7 +242,6 @@ void main() { hasEnabledState: true, isEnabled: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); handle.dispose(); @@ -322,7 +317,7 @@ void main() { SemanticsFlag.isFocusable, SemanticsFlag.isCheckStateMixed, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], ), hasLength(1)); await tester.pumpWidget( @@ -346,7 +341,7 @@ void main() { SemanticsFlag.isChecked, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], ), hasLength(1)); await tester.pumpWidget( @@ -369,7 +364,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], ), hasLength(1)); semantics.dispose(); diff --git a/packages/flutter/test/material/chip_test.dart b/packages/flutter/test/material/chip_test.dart index d86147d09915..0a398a1dad70 100644 --- a/packages/flutter/test/material/chip_test.dart +++ b/packages/flutter/test/material/chip_test.dart @@ -2971,7 +2971,7 @@ void main() { children: [ TestSemantics( tooltip: 'Delete', - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], textDirection: TextDirection.ltr, flags: [ SemanticsFlag.isButton, @@ -3030,7 +3030,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], ), ], ), @@ -3088,7 +3088,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], ), ], ), @@ -3141,7 +3141,7 @@ void main() { SemanticsFlag.isFocusable, SemanticsFlag.isSelected, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], ), ], ), @@ -3295,7 +3295,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], ), ], ), diff --git a/packages/flutter/test/material/date_picker_test.dart b/packages/flutter/test/material/date_picker_test.dart index 8ba368cbea18..df83154d4df5 100644 --- a/packages/flutter/test/material/date_picker_test.dart +++ b/packages/flutter/test/material/date_picker_test.dart @@ -1545,7 +1545,6 @@ void main() { label: '3, Sunday, January 3, 2016, Today', isButton: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); @@ -1554,7 +1553,6 @@ void main() { tooltip: 'Switch to input', isButton: true, hasTapAction: true, - hasFocusAction: true, isEnabled: true, hasEnabledState: true, isFocusable: true, @@ -1567,7 +1565,6 @@ void main() { label: 'OK', isButton: true, hasTapAction: true, - hasFocusAction: true, isEnabled: true, hasEnabledState: true, isFocusable: true, @@ -1576,7 +1573,6 @@ void main() { label: 'CANCEL', isButton: true, hasTapAction: true, - hasFocusAction: true, isEnabled: true, hasEnabledState: true, isFocusable: true, @@ -1607,7 +1603,6 @@ void main() { tooltip: 'Switch to calendar', isButton: true, hasTapAction: true, - hasFocusAction: true, isEnabled: true, hasEnabledState: true, isFocusable: true, @@ -1635,7 +1630,6 @@ void main() { label: 'OK', isButton: true, hasTapAction: true, - hasFocusAction: true, isEnabled: true, hasEnabledState: true, isFocusable: true, @@ -1644,7 +1638,6 @@ void main() { label: 'CANCEL', isButton: true, hasTapAction: true, - hasFocusAction: true, isEnabled: true, hasEnabledState: true, isFocusable: true, diff --git a/packages/flutter/test/material/date_range_picker_test.dart b/packages/flutter/test/material/date_range_picker_test.dart index dbe3cdd4ee9b..353e35d47aa9 100644 --- a/packages/flutter/test/material/date_range_picker_test.dart +++ b/packages/flutter/test/material/date_range_picker_test.dart @@ -1319,7 +1319,6 @@ void main() { matchesSemantics( label: '30, Saturday, January 30, 2016, Today', hasTapAction: true, - hasFocusAction: true, isFocusable: true, ), ); diff --git a/packages/flutter/test/material/drawer_button_test.dart b/packages/flutter/test/material/drawer_button_test.dart index e1fe73532385..bb565c8c7533 100644 --- a/packages/flutter/test/material/drawer_button_test.dart +++ b/packages/flutter/test/material/drawer_button_test.dart @@ -182,7 +182,6 @@ void main() { hasEnabledState: true, isEnabled: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); handle.dispose(); @@ -240,7 +239,6 @@ void main() { hasEnabledState: true, isEnabled: true, hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); handle.dispose(); diff --git a/packages/flutter/test/material/drawer_test.dart b/packages/flutter/test/material/drawer_test.dart index 1562be4b6552..36b9ae2ff501 100644 --- a/packages/flutter/test/material/drawer_test.dart +++ b/packages/flutter/test/material/drawer_test.dart @@ -147,7 +147,7 @@ void main() { expect(semantics, isNot(includesNodeWith( label: const DefaultMaterialLocalizations().modalBarrierDismissLabel, - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], ))); semantics.dispose(); diff --git a/packages/flutter/test/material/dropdown_test.dart b/packages/flutter/test/material/dropdown_test.dart index c04ae2b1aa47..5ec084aa05e5 100644 --- a/packages/flutter/test/material/dropdown_test.dart +++ b/packages/flutter/test/material/dropdown_test.dart @@ -1300,7 +1300,6 @@ void main() { isButton: true, label: 'test', hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); @@ -1316,7 +1315,6 @@ void main() { isButton: true, label: 'three', hasTapAction: true, - hasFocusAction: true, isFocusable: true, )); handle.dispose(); @@ -1362,28 +1360,28 @@ void main() { SemanticsFlag.isFocusable, ], tags: [const SemanticsTag('RenderViewport.twoPane')], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], ), TestSemantics( label: 'two', textDirection: TextDirection.ltr, flags: [SemanticsFlag.isFocusable], tags: [const SemanticsTag('RenderViewport.twoPane')], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], ), TestSemantics( label: 'three', textDirection: TextDirection.ltr, flags: [SemanticsFlag.isFocusable], tags: [const SemanticsTag('RenderViewport.twoPane')], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], ), TestSemantics( label: 'four', textDirection: TextDirection.ltr, flags: [SemanticsFlag.isFocusable], tags: [const SemanticsTag('RenderViewport.twoPane')], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], ), ], ), diff --git a/packages/flutter/test/material/elevated_button_test.dart b/packages/flutter/test/material/elevated_button_test.dart index d6627b5d9440..2e9d958bebf9 100644 --- a/packages/flutter/test/material/elevated_button_test.dart +++ b/packages/flutter/test/material/elevated_button_test.dart @@ -819,7 +819,6 @@ void main() { TestSemantics.rootChild( actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], label: 'ABC', rect: const Rect.fromLTRB(0.0, 0.0, 88.0, 48.0), diff --git a/packages/flutter/test/material/expand_icon_test.dart b/packages/flutter/test/material/expand_icon_test.dart index 7ff43ab84fdc..7ec1338fa447 100644 --- a/packages/flutter/test/material/expand_icon_test.dart +++ b/packages/flutter/test/material/expand_icon_test.dart @@ -217,7 +217,6 @@ void main() { expect(tester.getSemantics(find.byType(ExpandIcon)), matchesSemantics( hasTapAction: true, - hasFocusAction: true, hasEnabledState: true, isEnabled: true, isFocusable: true, @@ -234,7 +233,6 @@ void main() { expect(tester.getSemantics(find.byType(ExpandIcon)), matchesSemantics( hasTapAction: true, - hasFocusAction: true, hasEnabledState: true, isEnabled: true, isFocusable: true, @@ -260,7 +258,6 @@ void main() { children: [ matchesSemantics( hasTapAction: true, - hasFocusAction: true, hasEnabledState: true, isEnabled: true, isFocusable: true, @@ -280,7 +277,6 @@ void main() { children: [ matchesSemantics( hasTapAction: true, - hasFocusAction: true, hasEnabledState: true, isEnabled: true, isFocusable: true, diff --git a/packages/flutter/test/material/expansion_panel_test.dart b/packages/flutter/test/material/expansion_panel_test.dart index 8df161448fee..feab74d92d20 100644 --- a/packages/flutter/test/material/expansion_panel_test.dart +++ b/packages/flutter/test/material/expansion_panel_test.dart @@ -211,7 +211,6 @@ void main() { isEnabled: true, isFocusable: true, hasTapAction: true, - hasFocusAction: true, )); // Check custom header widget semantics is preserved. @@ -262,7 +261,6 @@ void main() { isEnabled: true, isFocusable: true, hasTapAction: true, - hasFocusAction: true, ), ], )); @@ -1101,7 +1099,6 @@ void main() { isEnabled: true, isFocusable: true, hasTapAction: true, - hasFocusAction: true, onTapHint: localizations.expandedIconTapHint, )); @@ -1126,7 +1123,6 @@ void main() { isEnabled: true, isFocusable: true, hasTapAction: true, - hasFocusAction: true, onTapHint: localizations.collapsedIconTapHint, )); @@ -1191,7 +1187,6 @@ void main() { isEnabled: true, isFocusable: true, hasTapAction: true, - hasFocusAction: true, ), ], )); @@ -1220,7 +1215,6 @@ void main() { isEnabled: true, isFocusable: true, hasTapAction: true, - hasFocusAction: true, ), ], )); @@ -1274,7 +1268,6 @@ void main() { isFocusable: true, hasEnabledState: true, hasTapAction: true, - hasFocusAction: true, )); expect(tester.getSemantics(find.byKey(collapsedKey)), matchesSemantics( @@ -1283,7 +1276,6 @@ void main() { isFocusable: true, hasEnabledState: true, hasTapAction: true, - hasFocusAction: true, )); handle.dispose(); diff --git a/packages/flutter/test/material/expansion_tile_test.dart b/packages/flutter/test/material/expansion_tile_test.dart index c6de9c673ecc..70daebbb82fe 100644 --- a/packages/flutter/test/material/expansion_tile_test.dart +++ b/packages/flutter/test/material/expansion_tile_test.dart @@ -728,7 +728,6 @@ void main() { tester.getSemantics(find.byType(ListTile).first), matchesSemantics( hasTapAction: true, - hasFocusAction: true, hasEnabledState: true, isEnabled: true, isFocused: true, @@ -743,7 +742,6 @@ void main() { tester.getSemantics(find.byType(ListTile).last), matchesSemantics( hasTapAction: true, - hasFocusAction: true, hasEnabledState: true, isEnabled: true, isFocusable: true, diff --git a/packages/flutter/test/material/filled_button_test.dart b/packages/flutter/test/material/filled_button_test.dart index ad7f766e191e..e0dcc9f26b58 100644 --- a/packages/flutter/test/material/filled_button_test.dart +++ b/packages/flutter/test/material/filled_button_test.dart @@ -1004,7 +1004,6 @@ void main() { TestSemantics.rootChild( actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], label: 'ABC', rect: const Rect.fromLTRB(0.0, 0.0, 88.0, 48.0), diff --git a/packages/flutter/test/material/floating_action_button_test.dart b/packages/flutter/test/material/floating_action_button_test.dart index 5a9f0148ced4..e5cfc6b3f5bd 100644 --- a/packages/flutter/test/material/floating_action_button_test.dart +++ b/packages/flutter/test/material/floating_action_button_test.dart @@ -631,7 +631,6 @@ void main() { ], actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], ), ], @@ -700,7 +699,6 @@ void main() { tooltip: 'Add Photo', actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], flags: [ SemanticsFlag.hasEnabledState, @@ -924,7 +922,6 @@ void main() { tester.getSemantics(find.byType(FloatingActionButton)), matchesSemantics( hasTapAction: true, - hasFocusAction: true, hasEnabledState: true, isButton: true, isEnabled: true, diff --git a/packages/flutter/test/material/icon_button_test.dart b/packages/flutter/test/material/icon_button_test.dart index cdae2a943185..7814043b7762 100644 --- a/packages/flutter/test/material/icon_button_test.dart +++ b/packages/flutter/test/material/icon_button_test.dart @@ -616,7 +616,6 @@ void main() { rect: const Rect.fromLTRB(0.0, 0.0, 48.0, 48.0), actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], flags: [ SemanticsFlag.hasEnabledState, @@ -691,7 +690,6 @@ void main() { TestSemantics( actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], flags: [ SemanticsFlag.hasEnabledState, @@ -2179,7 +2177,6 @@ void main() { TestSemantics.rootChild( actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], rect: const Rect.fromLTRB(0.0, 0.0, 88.0, 48.0), transform: Matrix4.translationValues(356.0, 276.0, 0.0), diff --git a/packages/flutter/test/material/ink_well_test.dart b/packages/flutter/test/material/ink_well_test.dart index 3cc961ccc10a..d90aded12e3e 100644 --- a/packages/flutter/test/material/ink_well_test.dart +++ b/packages/flutter/test/material/ink_well_test.dart @@ -1178,7 +1178,7 @@ testWidgets('InkResponse radius can be updated', (WidgetTester tester) async { ), ), )); - expect(semantics, includesNodeWith(label: 'Button', actions: [SemanticsAction.tap, SemanticsAction.focus])); + expect(semantics, includesNodeWith(label: 'Button', actions: [SemanticsAction.tap])); await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, @@ -1190,7 +1190,7 @@ testWidgets('InkResponse radius can be updated', (WidgetTester tester) async { ), ), )); - expect(semantics, isNot(includesNodeWith(label: 'Button', actions: [SemanticsAction.tap, SemanticsAction.focus]))); + expect(semantics, isNot(includesNodeWith(label: 'Button', actions: [SemanticsAction.tap]))); semantics.dispose(); }); @@ -1983,7 +1983,6 @@ testWidgets('InkResponse radius can be updated', (WidgetTester tester) async { label: 'Foo', hasLongPressAction: true, isFocusable: true, - hasFocusAction: true, textDirection: TextDirection.ltr, )); @@ -2004,7 +2003,6 @@ testWidgets('InkResponse radius can be updated', (WidgetTester tester) async { expect(tester.getSemantics(find.bySemanticsLabel('Foo')), matchesSemantics( label: 'Foo', hasTapAction: true, - hasFocusAction: true, hasLongPressAction: true, isFocusable: true, textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/material/list_tile_test.dart b/packages/flutter/test/material/list_tile_test.dart index 97d8ea6abe75..4860309ce34f 100644 --- a/packages/flutter/test/material/list_tile_test.dart +++ b/packages/flutter/test/material/list_tile_test.dart @@ -308,7 +308,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: 'two', ), TestSemantics.rootChild( diff --git a/packages/flutter/test/material/material_button_test.dart b/packages/flutter/test/material/material_button_test.dart index 4f1612bfa1c4..482812fdd899 100644 --- a/packages/flutter/test/material/material_button_test.dart +++ b/packages/flutter/test/material/material_button_test.dart @@ -620,7 +620,6 @@ void main() { label: 'Button', actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], flags: [ SemanticsFlag.hasEnabledState, @@ -662,7 +661,6 @@ void main() { SemanticsFlag.isButton, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.focus], ), ], ), diff --git a/packages/flutter/test/material/menu_anchor_test.dart b/packages/flutter/test/material/menu_anchor_test.dart index 85676da18347..3759ccf1915e 100644 --- a/packages/flutter/test/material/menu_anchor_test.dart +++ b/packages/flutter/test/material/menu_anchor_test.dart @@ -3421,7 +3421,6 @@ void main() { TestSemantics.rootChild( actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], label: 'ABC', rect: const Rect.fromLTRB(0.0, 0.0, 88.0, 48.0), @@ -3552,7 +3551,7 @@ void main() { SemanticsFlag.hasExpandedState, SemanticsFlag.isExpanded, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: 'ABC', rect: const Rect.fromLTRB(0.0, 0.0, 88.0, 48.0), ), @@ -3574,7 +3573,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], ), ], ), @@ -3622,7 +3621,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: 'ABC', rect: const Rect.fromLTRB(0.0, 0.0, 88.0, 48.0), ), diff --git a/packages/flutter/test/material/navigation_bar_test.dart b/packages/flutter/test/material/navigation_bar_test.dart index 01ff1cb19f42..f4676d597f6f 100644 --- a/packages/flutter/test/material/navigation_bar_test.dart +++ b/packages/flutter/test/material/navigation_bar_test.dart @@ -559,7 +559,6 @@ void main() { isFocusable: true, isSelected: true, hasTapAction: true, - hasFocusAction: true, ), ); expect( @@ -569,7 +568,6 @@ void main() { textDirection: TextDirection.ltr, isFocusable: true, hasTapAction: true, - hasFocusAction: true, ), ); @@ -582,7 +580,6 @@ void main() { textDirection: TextDirection.ltr, isFocusable: true, hasTapAction: true, - hasFocusAction: true, ), ); expect( @@ -593,7 +590,6 @@ void main() { isFocusable: true, isSelected: true, hasTapAction: true, - hasFocusAction: true, ), ); }); @@ -628,7 +624,6 @@ void main() { isFocusable: true, isSelected: true, hasTapAction: true, - hasFocusAction: true, ), ); expect( @@ -638,7 +633,6 @@ void main() { textDirection: TextDirection.ltr, isFocusable: true, hasTapAction: true, - hasFocusAction: true, ), ); @@ -651,7 +645,6 @@ void main() { textDirection: TextDirection.ltr, isFocusable: true, hasTapAction: true, - hasFocusAction: true, ), ); expect( @@ -662,7 +655,6 @@ void main() { isFocusable: true, isSelected: true, hasTapAction: true, - hasFocusAction: true, ), ); }); diff --git a/packages/flutter/test/material/navigation_drawer_test.dart b/packages/flutter/test/material/navigation_drawer_test.dart index d38a064469d5..35c39f918d3b 100644 --- a/packages/flutter/test/material/navigation_drawer_test.dart +++ b/packages/flutter/test/material/navigation_drawer_test.dart @@ -324,7 +324,6 @@ void main() { isFocusable: true, isSelected: true, hasTapAction: true, - hasFocusAction: true, ), ); expect( @@ -334,7 +333,6 @@ void main() { textDirection: TextDirection.ltr, isFocusable: true, hasTapAction: true, - hasFocusAction: true, ), ); @@ -347,7 +345,6 @@ void main() { textDirection: TextDirection.ltr, isFocusable: true, hasTapAction: true, - hasFocusAction: true, ), ); expect( @@ -358,7 +355,6 @@ void main() { isFocusable: true, isSelected: true, hasTapAction: true, - hasFocusAction: true, ), ); }); diff --git a/packages/flutter/test/material/navigation_rail_test.dart b/packages/flutter/test/material/navigation_rail_test.dart index 8e70e6cd2137..de70ed5f7ad5 100644 --- a/packages/flutter/test/material/navigation_rail_test.dart +++ b/packages/flutter/test/material/navigation_rail_test.dart @@ -5513,25 +5513,25 @@ TestSemantics _expectedSemantics() { SemanticsFlag.isSelected, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: 'Abc\nTab 1 of 4', textDirection: TextDirection.ltr, ), TestSemantics( flags: [SemanticsFlag.isFocusable], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: 'Def\nTab 2 of 4', textDirection: TextDirection.ltr, ), TestSemantics( flags: [SemanticsFlag.isFocusable], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: 'Ghi\nTab 3 of 4', textDirection: TextDirection.ltr, ), TestSemantics( flags: [SemanticsFlag.isFocusable], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: 'Jkl\nTab 4 of 4', textDirection: TextDirection.ltr, ), diff --git a/packages/flutter/test/material/outlined_button_test.dart b/packages/flutter/test/material/outlined_button_test.dart index e2a9235e8783..6b9241b7bc54 100644 --- a/packages/flutter/test/material/outlined_button_test.dart +++ b/packages/flutter/test/material/outlined_button_test.dart @@ -1073,7 +1073,6 @@ void main() { TestSemantics.rootChild( actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], label: 'ABC', rect: const Rect.fromLTRB(0.0, 0.0, 88.0, 48.0), diff --git a/packages/flutter/test/material/popup_menu_test.dart b/packages/flutter/test/material/popup_menu_test.dart index 7c530194526f..95cd7f0eba19 100644 --- a/packages/flutter/test/material/popup_menu_test.dart +++ b/packages/flutter/test/material/popup_menu_test.dart @@ -1219,7 +1219,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: '1', textDirection: TextDirection.ltr, ), @@ -1230,7 +1230,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: '2', textDirection: TextDirection.ltr, ), @@ -1241,7 +1241,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: '3', textDirection: TextDirection.ltr, ), @@ -1252,7 +1252,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: '4', textDirection: TextDirection.ltr, ), @@ -1263,7 +1263,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: '5', textDirection: TextDirection.ltr, ), @@ -1351,7 +1351,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: 'test1\ntest2', textDirection: TextDirection.ltr, ), @@ -1432,7 +1432,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: '1', textDirection: TextDirection.ltr, ), @@ -1452,7 +1452,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: '3', textDirection: TextDirection.ltr, ), @@ -1463,7 +1463,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: '4', textDirection: TextDirection.ltr, ), @@ -1474,7 +1474,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: '5', textDirection: TextDirection.ltr, ), diff --git a/packages/flutter/test/material/radio_list_tile_test.dart b/packages/flutter/test/material/radio_list_tile_test.dart index c1bb21ae1611..43355b2ce871 100644 --- a/packages/flutter/test/material/radio_list_tile_test.dart +++ b/packages/flutter/test/material/radio_list_tile_test.dart @@ -411,7 +411,7 @@ void main() { SemanticsFlag.isInMutuallyExclusiveGroup, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: 'Title', textDirection: TextDirection.ltr, ), @@ -448,7 +448,7 @@ void main() { SemanticsFlag.isInMutuallyExclusiveGroup, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: 'Title', textDirection: TextDirection.ltr, ), @@ -483,7 +483,6 @@ void main() { SemanticsFlag.isInMutuallyExclusiveGroup, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.focus], label: 'Title', textDirection: TextDirection.ltr, ), diff --git a/packages/flutter/test/material/radio_test.dart b/packages/flutter/test/material/radio_test.dart index 8b0456b7fc8c..4aabeed1a87a 100644 --- a/packages/flutter/test/material/radio_test.dart +++ b/packages/flutter/test/material/radio_test.dart @@ -221,7 +221,6 @@ void main() { ], actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], ), ); @@ -255,7 +254,6 @@ void main() { ], actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], ), ], @@ -286,7 +284,6 @@ void main() { ], actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], ), ], @@ -313,7 +310,6 @@ void main() { SemanticsFlag.isInMutuallyExclusiveGroup, SemanticsFlag.isFocusable, // This flag is delayed by 1 frame. ], - actions: [SemanticsAction.focus], ), ], ), ignoreRect: true, ignoreTransform: true)); diff --git a/packages/flutter/test/material/raw_material_button_test.dart b/packages/flutter/test/material/raw_material_button_test.dart index 5f17df39f71e..d58db5f7851e 100644 --- a/packages/flutter/test/material/raw_material_button_test.dart +++ b/packages/flutter/test/material/raw_material_button_test.dart @@ -160,7 +160,6 @@ void main() { ], actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], label: '+', textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/material/reorderable_list_test.dart b/packages/flutter/test/material/reorderable_list_test.dart index fcd36d7d5c63..5595fe6448fc 100644 --- a/packages/flutter/test/material/reorderable_list_test.dart +++ b/packages/flutter/test/material/reorderable_list_test.dart @@ -751,7 +751,6 @@ void main() { hasEnabledState: true, label: 'Switch tile', hasTapAction: true, - hasFocusAction: true, )); handle.dispose(); }); diff --git a/packages/flutter/test/material/search_test.dart b/packages/flutter/test/material/search_test.dart index 61963b37ecf8..79e856c6cb74 100644 --- a/packages/flutter/test/material/search_test.dart +++ b/packages/flutter/test/material/search_test.dart @@ -662,7 +662,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], tooltip: 'Back', textDirection: TextDirection.ltr, ), @@ -718,7 +718,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: 'Suggestions', textDirection: TextDirection.ltr, ), @@ -812,7 +812,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], tooltip: 'Back', textDirection: TextDirection.ltr, ), @@ -856,7 +856,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: 'Suggestions', textDirection: TextDirection.ltr, ), diff --git a/packages/flutter/test/material/segmented_button_test.dart b/packages/flutter/test/material/segmented_button_test.dart index 4ad9d933b07b..c4a2f2bcd066 100644 --- a/packages/flutter/test/material/segmented_button_test.dart +++ b/packages/flutter/test/material/segmented_button_test.dart @@ -449,7 +449,6 @@ void main() { label: '1', actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], ), @@ -467,7 +466,6 @@ void main() { label: '2', actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], ), @@ -531,7 +529,6 @@ void main() { label: '1', actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], ), @@ -547,7 +544,6 @@ void main() { label: '2', actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], ), diff --git a/packages/flutter/test/material/slider_test.dart b/packages/flutter/test/material/slider_test.dart index 9f2786db2e30..cb26860d9150 100644 --- a/packages/flutter/test/material/slider_test.dart +++ b/packages/flutter/test/material/slider_test.dart @@ -1292,7 +1292,6 @@ void main() { SemanticsFlag.isSlider, ], actions: [ - SemanticsAction.focus, SemanticsAction.increase, SemanticsAction.decrease, ], @@ -1351,7 +1350,6 @@ void main() { SemanticsFlag.isFocusable, SemanticsFlag.isSlider, ], - actions: [SemanticsAction.focus], value: '50%', increasedValue: '55%', decreasedValue: '45%', @@ -1454,7 +1452,7 @@ void main() { TestSemantics( id: 4, flags: [SemanticsFlag.hasEnabledState, SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, SemanticsFlag.isSlider], - actions: [SemanticsAction.focus, SemanticsAction.increase, SemanticsAction.decrease], + actions: [SemanticsAction.increase, SemanticsAction.decrease], value: '50%', increasedValue: '60%', decreasedValue: '40%', @@ -1567,7 +1565,6 @@ void main() { SemanticsFlag.isSlider, ], actions: [ - SemanticsAction.focus, SemanticsAction.increase, SemanticsAction.decrease, SemanticsAction.didGainAccessibilityFocus, @@ -1628,7 +1625,6 @@ void main() { SemanticsFlag.isSlider, ], actions: [ - SemanticsAction.focus, SemanticsAction.didGainAccessibilityFocus, ], value: '50%', @@ -1733,7 +1729,7 @@ void main() { TestSemantics( id: 4, flags: [SemanticsFlag.hasEnabledState, SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, SemanticsFlag.isSlider], - actions: [SemanticsAction.focus, SemanticsAction.increase, SemanticsAction.decrease], + actions: [SemanticsAction.increase, SemanticsAction.decrease], value: '40', increasedValue: '60', decreasedValue: '20', @@ -1793,7 +1789,7 @@ void main() { TestSemantics( id: 4, flags: [SemanticsFlag.hasEnabledState, SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, SemanticsFlag.isSlider], - actions: [SemanticsAction.focus, SemanticsAction.increase, SemanticsAction.decrease], + actions: [SemanticsAction.increase, SemanticsAction.decrease], value: '40', increasedValue: '60', decreasedValue: '20', @@ -2637,7 +2633,6 @@ void main() { SemanticsFlag.isSlider, ], actions: [ - SemanticsAction.focus, SemanticsAction.increase, SemanticsAction.decrease, SemanticsAction.didGainAccessibilityFocus, diff --git a/packages/flutter/test/material/switch_list_tile_test.dart b/packages/flutter/test/material/switch_list_tile_test.dart index c42b4e0ac615..bfdf3ba9e500 100644 --- a/packages/flutter/test/material/switch_list_tile_test.dart +++ b/packages/flutter/test/material/switch_list_tile_test.dart @@ -78,7 +78,7 @@ void main() { SemanticsFlag.isFocusable, SemanticsFlag.isToggled, ], - actions: SemanticsAction.tap.index | SemanticsAction.focus.index, + actions: SemanticsAction.tap.index, label: 'aaa\nAAA', ), TestSemantics.rootChild( @@ -92,7 +92,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: SemanticsAction.tap.index | SemanticsAction.focus.index, + actions: SemanticsAction.tap.index, label: 'bbb\nBBB', ), TestSemantics.rootChild( @@ -106,7 +106,7 @@ void main() { SemanticsFlag.isFocusable, SemanticsFlag.isInMutuallyExclusiveGroup, ], - actions: SemanticsAction.tap.index | SemanticsAction.focus.index, + actions: SemanticsAction.tap.index, label: 'CCC\nccc', ), ], diff --git a/packages/flutter/test/material/tabs_test.dart b/packages/flutter/test/material/tabs_test.dart index d0b66dce9016..aa9091fb6bf2 100644 --- a/packages/flutter/test/material/tabs_test.dart +++ b/packages/flutter/test/material/tabs_test.dart @@ -3592,7 +3592,7 @@ void main() { children: [ TestSemantics( id: 4, - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], flags: [ SemanticsFlag.isSelected, SemanticsFlag.isFocusable, @@ -3604,7 +3604,7 @@ void main() { TestSemantics( id: 5, flags: [SemanticsFlag.isFocusable], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: 'TAB #1\nTab 2 of 2', rect: const Rect.fromLTRB(0.0, 0.0, 116.0, kTextTabBarHeight), transform: Matrix4.translationValues(116.0, 276.0, 0.0), @@ -3863,7 +3863,7 @@ void main() { SemanticsFlag.isSelected, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: 'Semantics override 0\nTab 1 of 2', rect: const Rect.fromLTRB(0.0, 0.0, 116.0, kTextTabBarHeight), transform: Matrix4.translationValues(0.0, 276.0, 0.0), @@ -3871,7 +3871,7 @@ void main() { TestSemantics( id: 5, flags: [SemanticsFlag.isFocusable], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: 'Semantics override 1\nTab 2 of 2', rect: const Rect.fromLTRB(0.0, 0.0, 116.0, kTextTabBarHeight), transform: Matrix4.translationValues(116.0, 276.0, 0.0), @@ -5652,14 +5652,14 @@ void main() { flags: [SemanticsFlag.isFocusable, SemanticsFlag.isSelected], id: 2, rect: TestSemantics.fullScreen, - actions: 1 | SemanticsAction.focus.index, + actions: 1, ), TestSemantics( label: 'TAB2\nTab 2 of 2', flags: [SemanticsFlag.isFocusable], id: 3, rect: TestSemantics.fullScreen, - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], ), TestSemantics( id: 4, diff --git a/packages/flutter/test/material/text_button_test.dart b/packages/flutter/test/material/text_button_test.dart index 640d9649f895..f213635cb783 100644 --- a/packages/flutter/test/material/text_button_test.dart +++ b/packages/flutter/test/material/text_button_test.dart @@ -607,7 +607,6 @@ void main() { TestSemantics.rootChild( actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], label: 'ABC', rect: const Rect.fromLTRB(0.0, 0.0, 88.0, 48.0), diff --git a/packages/flutter/test/material/text_field_test.dart b/packages/flutter/test/material/text_field_test.dart index fd1f69e7914a..1f667d152eed 100644 --- a/packages/flutter/test/material/text_field_test.dart +++ b/packages/flutter/test/material/text_field_test.dart @@ -6964,7 +6964,7 @@ void main() { ), ); - expect(semantics, isNot(includesNodeWith(actions: [SemanticsAction.tap, SemanticsAction.focus]))); + expect(semantics, isNot(includesNodeWith(actions: [SemanticsAction.tap]))); semantics.dispose(); }); @@ -7005,7 +7005,7 @@ void main() { ), ); - expect(semantics, isNot(includesNodeWith(actions: [SemanticsAction.tap, SemanticsAction.focus]))); + expect(semantics, isNot(includesNodeWith(actions: [SemanticsAction.tap]))); semantics.dispose(); }); diff --git a/packages/flutter/test/material/time_picker_test.dart b/packages/flutter/test/material/time_picker_test.dart index 1236c63fc111..60b44a4bc533 100644 --- a/packages/flutter/test/material/time_picker_test.dart +++ b/packages/flutter/test/material/time_picker_test.dart @@ -1250,7 +1250,7 @@ void main() { semantics, includesNodeWith( label: amString, - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], flags: [ SemanticsFlag.isButton, SemanticsFlag.isChecked, @@ -1264,7 +1264,7 @@ void main() { semantics, includesNodeWith( label: pmString, - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], flags: [ SemanticsFlag.isButton, SemanticsFlag.isInMutuallyExclusiveGroup, diff --git a/packages/flutter/test/material/toggle_buttons_test.dart b/packages/flutter/test/material/toggle_buttons_test.dart index 9da18f8f8d9a..1681ca3a8015 100644 --- a/packages/flutter/test/material/toggle_buttons_test.dart +++ b/packages/flutter/test/material/toggle_buttons_test.dart @@ -2117,7 +2117,6 @@ void main() { ], actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], rect: const Rect.fromLTRB(0.0, 0.0, 87.0, 48.0), ), @@ -2131,7 +2130,6 @@ void main() { ], actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], rect: const Rect.fromLTRB(0.0, 0.0, 88.0, 48.0) ), @@ -2145,7 +2143,6 @@ void main() { ], actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], rect: const Rect.fromLTRB(0.0, 0.0, 88.0, 48.0), ), @@ -2191,7 +2188,6 @@ void main() { ], actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], ), TestSemantics( @@ -2205,7 +2201,6 @@ void main() { ], actions: [ SemanticsAction.tap, - SemanticsAction.focus, ], ), ], diff --git a/packages/flutter/test/material/user_accounts_drawer_header_test.dart b/packages/flutter/test/material/user_accounts_drawer_header_test.dart index 1da4ab880b20..a106eaabf8fb 100644 --- a/packages/flutter/test/material/user_accounts_drawer_header_test.dart +++ b/packages/flutter/test/material/user_accounts_drawer_header_test.dart @@ -531,7 +531,6 @@ void main() { flags: [SemanticsFlag.isFocusable], label: 'Signed in\nname\nemail', textDirection: TextDirection.ltr, - actions: [SemanticsAction.focus], children: [ TestSemantics( label: r'B', diff --git a/packages/flutter/test/widgets/absorb_pointer_test.dart b/packages/flutter/test/widgets/absorb_pointer_test.dart index 5952cc69b28e..6c2a88f58ca4 100644 --- a/packages/flutter/test/widgets/absorb_pointer_test.dart +++ b/packages/flutter/test/widgets/absorb_pointer_test.dart @@ -48,7 +48,6 @@ void main() { matchesSemantics( label: 'button', hasTapAction: true, - hasFocusAction: true, isButton: true, isFocusable: true, hasEnabledState: true, diff --git a/packages/flutter/test/widgets/actions_test.dart b/packages/flutter/test/widgets/actions_test.dart index 3b87e8c44f3c..87d2f2b0e117 100644 --- a/packages/flutter/test/widgets/actions_test.dart +++ b/packages/flutter/test/widgets/actions_test.dart @@ -1013,11 +1013,9 @@ void main() { // This semantic is from `Focus` widget under `FocusableActionDetector`. matchesSemantics( isFocusable: true, - hasFocusAction: true, children: [ matchesSemantics( hasTapAction: true, - hasFocusAction: true, isButton: true, hasEnabledState: true, isEnabled: true, @@ -1027,7 +1025,6 @@ void main() { ), matchesSemantics( hasTapAction: true, - hasFocusAction: true, isButton: true, hasEnabledState: true, isEnabled: true, @@ -1071,7 +1068,6 @@ void main() { children: [ matchesSemantics( hasTapAction: true, - hasFocusAction: true, isButton: true, hasEnabledState: true, isEnabled: true, @@ -1081,7 +1077,6 @@ void main() { ), matchesSemantics( hasTapAction: true, - hasFocusAction: true, isButton: true, hasEnabledState: true, isEnabled: true, diff --git a/packages/flutter/test/widgets/basic_test.dart b/packages/flutter/test/widgets/basic_test.dart index ee472a90854c..8ad224376c0d 100644 --- a/packages/flutter/test/widgets/basic_test.dart +++ b/packages/flutter/test/widgets/basic_test.dart @@ -858,7 +858,6 @@ void main() { matchesSemantics( label: 'button', hasTapAction: true, - hasFocusAction: true, isButton: true, isFocusable: true, hasEnabledState: true, diff --git a/packages/flutter/test/widgets/drawer_test.dart b/packages/flutter/test/widgets/drawer_test.dart index e6741fb2f281..cb3aba7fd828 100644 --- a/packages/flutter/test/widgets/drawer_test.dart +++ b/packages/flutter/test/widgets/drawer_test.dart @@ -348,7 +348,7 @@ void main() { scaffoldKey.currentState!.openDrawer(); await tester.pump(const Duration(milliseconds: 100)); - expect(semantics, isNot(includesNodeWith(actions: [SemanticsAction.tap, SemanticsAction.focus]))); + expect(semantics, isNot(includesNodeWith(actions: [SemanticsAction.tap]))); expect(semantics, isNot(includesNodeWith(label: 'Dismiss'))); semantics.dispose(); diff --git a/packages/flutter/test/widgets/focus_scope_test.dart b/packages/flutter/test/widgets/focus_scope_test.dart index ad5514c90919..13b25fe370b6 100644 --- a/packages/flutter/test/widgets/focus_scope_test.dart +++ b/packages/flutter/test/widgets/focus_scope_test.dart @@ -1999,47 +1999,6 @@ void main() { ), ); }); - - testWidgets('Focus widget gains input focus when it gains accessibility focus', (WidgetTester tester) async { - final SemanticsTester semantics = SemanticsTester(tester); - final SemanticsOwner semanticsOwner = tester.binding.pipelineOwner.semanticsOwner!; - final FocusNode focusNode = FocusNode(); - addTearDown(focusNode.dispose); - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.rtl, - child: Focus( - focusNode: focusNode, - child: const Text('Test'), - ), - ), - ); - - expect( - semantics, - hasSemantics( - TestSemantics.root( - children: [ - TestSemantics( - id: 1, - flags: [SemanticsFlag.isFocusable], - actions: [SemanticsAction.focus], - label: 'Test', - textDirection: TextDirection.rtl, - ), - ], - ), - ignoreRect: true, - ignoreTransform: true, - ), - ); - - expect(focusNode.hasFocus, isFalse); - semanticsOwner.performAction(1, SemanticsAction.focus); - await tester.pumpAndSettle(); - expect(focusNode.hasFocus, isTrue); - semantics.dispose(); - }); }); group('ExcludeFocus', () { diff --git a/packages/flutter/test/widgets/focus_traversal_test.dart b/packages/flutter/test/widgets/focus_traversal_test.dart index 27ef9d5b3c1c..9d9f2157305a 100644 --- a/packages/flutter/test/widgets/focus_traversal_test.dart +++ b/packages/flutter/test/widgets/focus_traversal_test.dart @@ -3182,9 +3182,6 @@ void main() { flags: [ SemanticsFlag.isFocusable, ], - actions: [ - SemanticsAction.focus, - ], ), ], ); diff --git a/packages/flutter/test/widgets/gesture_detector_semantics_test.dart b/packages/flutter/test/widgets/gesture_detector_semantics_test.dart index d2de05663032..4632cf53bc59 100644 --- a/packages/flutter/test/widgets/gesture_detector_semantics_test.dart +++ b/packages/flutter/test/widgets/gesture_detector_semantics_test.dart @@ -333,7 +333,7 @@ void main() { ); expect(semantics, isNot(includesNodeWith( - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], ))); semantics.dispose(); diff --git a/packages/flutter/test/widgets/selectable_region_test.dart b/packages/flutter/test/widgets/selectable_region_test.dart index c1710f8dd36e..6877d6f9b7a5 100644 --- a/packages/flutter/test/widgets/selectable_region_test.dart +++ b/packages/flutter/test/widgets/selectable_region_test.dart @@ -260,7 +260,7 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable ], - actions: [SemanticsAction.tap, SemanticsAction.focus], + actions: [SemanticsAction.tap], label: 'Button', textDirection: TextDirection.ltr, ), diff --git a/packages/flutter_test/lib/src/matchers.dart b/packages/flutter_test/lib/src/matchers.dart index 9d75b379f56f..6e955a4fdb2c 100644 --- a/packages/flutter_test/lib/src/matchers.dart +++ b/packages/flutter_test/lib/src/matchers.dart @@ -674,7 +674,6 @@ Matcher matchesSemantics({ bool isExpanded = false, // Actions // bool hasTapAction = false, - bool hasFocusAction = false, bool hasLongPressAction = false, bool hasScrollLeftAction = false, bool hasScrollRightAction = false, @@ -754,7 +753,6 @@ Matcher matchesSemantics({ isExpanded: isExpanded, // Actions hasTapAction: hasTapAction, - hasFocusAction: hasFocusAction, hasLongPressAction: hasLongPressAction, hasScrollLeftAction: hasScrollLeftAction, hasScrollRightAction: hasScrollRightAction, @@ -862,7 +860,6 @@ Matcher containsSemantics({ bool? isExpanded, // Actions bool? hasTapAction, - bool? hasFocusAction, bool? hasLongPressAction, bool? hasScrollLeftAction, bool? hasScrollRightAction, @@ -942,7 +939,6 @@ Matcher containsSemantics({ isExpanded: isExpanded, // Actions hasTapAction: hasTapAction, - hasFocusAction: hasFocusAction, hasLongPressAction: hasLongPressAction, hasScrollLeftAction: hasScrollLeftAction, hasScrollRightAction: hasScrollRightAction, @@ -2263,7 +2259,6 @@ class _MatchesSemanticsData extends Matcher { required bool? isExpanded, // Actions required bool? hasTapAction, - required bool? hasFocusAction, required bool? hasLongPressAction, required bool? hasScrollLeftAction, required bool? hasScrollRightAction, @@ -2322,7 +2317,6 @@ class _MatchesSemanticsData extends Matcher { }, actions = { if (hasTapAction != null) SemanticsAction.tap: hasTapAction, - if (hasFocusAction != null) SemanticsAction.focus: hasFocusAction, if (hasLongPressAction != null) SemanticsAction.longPress: hasLongPressAction, if (hasScrollLeftAction != null) SemanticsAction.scrollLeft: hasScrollLeftAction, if (hasScrollRightAction != null) SemanticsAction.scrollRight: hasScrollRightAction, @@ -2385,8 +2379,8 @@ class _MatchesSemanticsData extends Matcher { final Map flags; @override - Description describe(Description description, [String? index]) { - description.add('${index == null ? '' : 'Child $index '}has semantics'); + Description describe(Description description) { + description.add('has semantics'); if (label != null) { description.add(' with label: $label'); } @@ -2485,15 +2479,9 @@ class _MatchesSemanticsData extends Matcher { description.add(' with custom hints: $hintOverrides'); } if (children != null) { - description.add(' with children:\n '); - final List<_MatchesSemanticsData> childMatches = children!.cast<_MatchesSemanticsData>(); - int childIndex = 1; - for (final _MatchesSemanticsData child in childMatches) { - child.describe(description, index != null ? '$index:$childIndex': '$childIndex'); - if (child != childMatches.last) { - description.add('\n '); - } - childIndex += 1; + description.add(' with children:\n'); + for (final _MatchesSemanticsData child in children!.cast<_MatchesSemanticsData>()) { + child.describe(description); } } return description; diff --git a/packages/flutter_test/test/matchers_test.dart b/packages/flutter_test/test/matchers_test.dart index 034316d6d487..dd3f08f707da 100644 --- a/packages/flutter_test/test/matchers_test.dart +++ b/packages/flutter_test/test/matchers_test.dart @@ -746,7 +746,6 @@ void main() { hasDidGainAccessibilityFocusAction: true, hasDidLoseAccessibilityFocusAction: true, hasDismissAction: true, - hasFocusAction: true, customActions: [action], )); }); @@ -1034,7 +1033,6 @@ void main() { hasDidGainAccessibilityFocusAction: true, hasDidLoseAccessibilityFocusAction: true, hasDismissAction: true, - hasFocusAction: true, customActions: [action], ), ); @@ -1127,7 +1125,6 @@ void main() { hasDidGainAccessibilityFocusAction: false, hasDidLoseAccessibilityFocusAction: false, hasDismissAction: false, - hasFocusAction: false, ), ); });