diff --git a/packages/flutter/lib/src/material/list_tile.dart b/packages/flutter/lib/src/material/list_tile.dart index 19af6616fd..8c50e88c09 100644 --- a/packages/flutter/lib/src/material/list_tile.dart +++ b/packages/flutter/lib/src/material/list_tile.dart @@ -910,6 +910,7 @@ class ListTile extends StatelessWidget { autofocus: autofocus, enableFeedback: enableFeedback ?? tileTheme.enableFeedback ?? true, child: Semantics( + button: onTap != null || onLongPress != null, selected: selected, enabled: enabled, child: Ink( diff --git a/packages/flutter/test/material/checkbox_list_tile_test.dart b/packages/flutter/test/material/checkbox_list_tile_test.dart index 3f897b934b..da32288f0b 100644 --- a/packages/flutter/test/material/checkbox_list_tile_test.dart +++ b/packages/flutter/test/material/checkbox_list_tile_test.dart @@ -1184,6 +1184,7 @@ void main() { )); expect(tester.getSemantics(find.byType(CheckboxListTile)), matchesSemantics( + isButton: true, hasCheckedState: true, isChecked: true, hasEnabledState: true, diff --git a/packages/flutter/test/material/expansion_tile_test.dart b/packages/flutter/test/material/expansion_tile_test.dart index 78c4d96833..32e299658b 100644 --- a/packages/flutter/test/material/expansion_tile_test.dart +++ b/packages/flutter/test/material/expansion_tile_test.dart @@ -727,6 +727,7 @@ void main() { expect( tester.getSemantics(find.byType(ListTile).first), matchesSemantics( + isButton: true, hasTapAction: true, hasFocusAction: true, hasEnabledState: true, @@ -742,6 +743,7 @@ void main() { expect( tester.getSemantics(find.byType(ListTile).last), matchesSemantics( + isButton: true, hasTapAction: true, hasFocusAction: true, hasEnabledState: true, diff --git a/packages/flutter/test/material/list_tile_test.dart b/packages/flutter/test/material/list_tile_test.dart index 97d8ea6abe..68aa2cb058 100644 --- a/packages/flutter/test/material/list_tile_test.dart +++ b/packages/flutter/test/material/list_tile_test.dart @@ -304,6 +304,7 @@ void main() { ), TestSemantics.rootChild( flags: [ + SemanticsFlag.isButton, SemanticsFlag.hasEnabledState, SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, diff --git a/packages/flutter/test/material/radio_list_tile_test.dart b/packages/flutter/test/material/radio_list_tile_test.dart index b2a4a40ab5..0d042c1a56 100644 --- a/packages/flutter/test/material/radio_list_tile_test.dart +++ b/packages/flutter/test/material/radio_list_tile_test.dart @@ -405,6 +405,7 @@ void main() { TestSemantics( id: 1, flags: [ + SemanticsFlag.isButton, SemanticsFlag.hasCheckedState, SemanticsFlag.hasEnabledState, SemanticsFlag.isEnabled, @@ -441,6 +442,7 @@ void main() { TestSemantics( id: 1, flags: [ + SemanticsFlag.isButton, SemanticsFlag.hasCheckedState, SemanticsFlag.isChecked, SemanticsFlag.hasEnabledState, diff --git a/packages/flutter/test/material/reorderable_list_test.dart b/packages/flutter/test/material/reorderable_list_test.dart index fcd36d7d5c..7ca97032a9 100644 --- a/packages/flutter/test/material/reorderable_list_test.dart +++ b/packages/flutter/test/material/reorderable_list_test.dart @@ -744,6 +744,7 @@ void main() { return false; }); expect(child, matchesSemantics( + isButton: true, hasToggledState: true, isToggled: true, isEnabled: true, diff --git a/packages/flutter/test/material/switch_list_tile_test.dart b/packages/flutter/test/material/switch_list_tile_test.dart index 5d5c8b43e9..db1c308037 100644 --- a/packages/flutter/test/material/switch_list_tile_test.dart +++ b/packages/flutter/test/material/switch_list_tile_test.dart @@ -72,6 +72,7 @@ void main() { id: 1, rect: const Rect.fromLTWH(0.0, 0.0, 800.0, 56.0), flags: [ + SemanticsFlag.isButton, SemanticsFlag.hasEnabledState, SemanticsFlag.hasToggledState, SemanticsFlag.isEnabled, @@ -86,6 +87,7 @@ void main() { rect: const Rect.fromLTWH(0.0, 0.0, 800.0, 56.0), transform: Matrix4.translationValues(0.0, 56.0, 0.0), flags: [ + SemanticsFlag.isButton, SemanticsFlag.hasCheckedState, SemanticsFlag.hasEnabledState, SemanticsFlag.isChecked, @@ -100,6 +102,7 @@ void main() { rect: const Rect.fromLTWH(0.0, 0.0, 800.0, 56.0), transform: Matrix4.translationValues(0.0, 112.0, 0.0), flags: [ + SemanticsFlag.isButton, SemanticsFlag.hasCheckedState, SemanticsFlag.hasEnabledState, SemanticsFlag.isEnabled,