Unverified Commit 1e87fdd8 authored by hangyu's avatar hangyu Committed by GitHub

Add button semantics in list tile (#112593)

parent c7a0218a
...@@ -747,6 +747,7 @@ class ListTile extends StatelessWidget { ...@@ -747,6 +747,7 @@ class ListTile extends StatelessWidget {
autofocus: autofocus, autofocus: autofocus,
enableFeedback: enableFeedback ?? tileTheme.enableFeedback ?? true, enableFeedback: enableFeedback ?? tileTheme.enableFeedback ?? true,
child: Semantics( child: Semantics(
button: onTap != null,
selected: selected, selected: selected,
enabled: enabled, enabled: enabled,
child: Ink( child: Ink(
......
...@@ -325,6 +325,7 @@ void main() { ...@@ -325,6 +325,7 @@ void main() {
), ),
TestSemantics.rootChild( TestSemantics.rootChild(
flags: <SemanticsFlag>[ flags: <SemanticsFlag>[
SemanticsFlag.isButton,
SemanticsFlag.hasEnabledState, SemanticsFlag.hasEnabledState,
SemanticsFlag.isEnabled, SemanticsFlag.isEnabled,
SemanticsFlag.isFocusable, SemanticsFlag.isFocusable,
......
...@@ -407,6 +407,7 @@ void main() { ...@@ -407,6 +407,7 @@ void main() {
SemanticsFlag.hasCheckedState, SemanticsFlag.hasCheckedState,
SemanticsFlag.hasEnabledState, SemanticsFlag.hasEnabledState,
SemanticsFlag.isEnabled, SemanticsFlag.isEnabled,
SemanticsFlag.isButton,
SemanticsFlag.isInMutuallyExclusiveGroup, SemanticsFlag.isInMutuallyExclusiveGroup,
SemanticsFlag.isFocusable, SemanticsFlag.isFocusable,
], ],
...@@ -444,6 +445,7 @@ void main() { ...@@ -444,6 +445,7 @@ void main() {
SemanticsFlag.isChecked, SemanticsFlag.isChecked,
SemanticsFlag.hasEnabledState, SemanticsFlag.hasEnabledState,
SemanticsFlag.isEnabled, SemanticsFlag.isEnabled,
SemanticsFlag.isButton,
SemanticsFlag.isInMutuallyExclusiveGroup, SemanticsFlag.isInMutuallyExclusiveGroup,
SemanticsFlag.isFocusable, SemanticsFlag.isFocusable,
], ],
......
...@@ -677,6 +677,7 @@ void main() { ...@@ -677,6 +677,7 @@ void main() {
hasToggledState: true, hasToggledState: true,
isToggled: true, isToggled: true,
isEnabled: true, isEnabled: true,
isButton: true,
isFocusable: true, isFocusable: true,
hasEnabledState: true, hasEnabledState: true,
label: 'Switch tile', label: 'Switch tile',
......
...@@ -76,6 +76,7 @@ void main() { ...@@ -76,6 +76,7 @@ void main() {
SemanticsFlag.hasEnabledState, SemanticsFlag.hasEnabledState,
SemanticsFlag.hasToggledState, SemanticsFlag.hasToggledState,
SemanticsFlag.isEnabled, SemanticsFlag.isEnabled,
SemanticsFlag.isButton,
SemanticsFlag.isFocusable, SemanticsFlag.isFocusable,
SemanticsFlag.isToggled, SemanticsFlag.isToggled,
], ],
...@@ -91,6 +92,7 @@ void main() { ...@@ -91,6 +92,7 @@ void main() {
SemanticsFlag.hasEnabledState, SemanticsFlag.hasEnabledState,
SemanticsFlag.isChecked, SemanticsFlag.isChecked,
SemanticsFlag.isEnabled, SemanticsFlag.isEnabled,
SemanticsFlag.isButton,
SemanticsFlag.isFocusable, SemanticsFlag.isFocusable,
], ],
actions: SemanticsAction.tap.index, actions: SemanticsAction.tap.index,
...@@ -104,6 +106,7 @@ void main() { ...@@ -104,6 +106,7 @@ void main() {
SemanticsFlag.hasCheckedState, SemanticsFlag.hasCheckedState,
SemanticsFlag.hasEnabledState, SemanticsFlag.hasEnabledState,
SemanticsFlag.isEnabled, SemanticsFlag.isEnabled,
SemanticsFlag.isButton,
SemanticsFlag.isFocusable, SemanticsFlag.isFocusable,
SemanticsFlag.isInMutuallyExclusiveGroup, SemanticsFlag.isInMutuallyExclusiveGroup,
], ],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment