Use correct semantics for toggle buttons (#113851)
* Use correct semantics for toggle buttons * x
This commit is contained in:
@@ -798,7 +798,7 @@ class ToggleButtons extends StatelessWidget {
|
||||
return MergeSemantics(
|
||||
child: Semantics(
|
||||
container: true,
|
||||
toggled: isSelected[index],
|
||||
checked: isSelected[index],
|
||||
enabled: onPressed != null,
|
||||
child: _InputPadding(
|
||||
minSize: minPaddingSize,
|
||||
|
||||
@@ -2006,7 +2006,7 @@ void main() {
|
||||
SemanticsFlag.isButton,
|
||||
SemanticsFlag.isEnabled,
|
||||
SemanticsFlag.hasEnabledState,
|
||||
SemanticsFlag.hasToggledState,
|
||||
SemanticsFlag.hasCheckedState,
|
||||
SemanticsFlag.isFocusable,
|
||||
],
|
||||
actions: <SemanticsAction>[
|
||||
@@ -2019,7 +2019,7 @@ void main() {
|
||||
SemanticsFlag.isButton,
|
||||
SemanticsFlag.isEnabled,
|
||||
SemanticsFlag.hasEnabledState,
|
||||
SemanticsFlag.hasToggledState,
|
||||
SemanticsFlag.hasCheckedState,
|
||||
SemanticsFlag.isFocusable,
|
||||
],
|
||||
actions: <SemanticsAction>[
|
||||
@@ -2032,7 +2032,7 @@ void main() {
|
||||
SemanticsFlag.isButton,
|
||||
SemanticsFlag.isEnabled,
|
||||
SemanticsFlag.hasEnabledState,
|
||||
SemanticsFlag.hasToggledState,
|
||||
SemanticsFlag.hasCheckedState,
|
||||
SemanticsFlag.isFocusable,
|
||||
],
|
||||
actions: <SemanticsAction>[
|
||||
@@ -2051,7 +2051,7 @@ void main() {
|
||||
semantics.dispose();
|
||||
});
|
||||
|
||||
testWidgets('Toggle buttons have correct semantics', (WidgetTester tester) async {
|
||||
testWidgets('Toggle buttons have correct semantics', (WidgetTester tester) async {
|
||||
final SemanticsTester semantics = SemanticsTester(tester);
|
||||
|
||||
await tester.pumpWidget(
|
||||
@@ -2079,7 +2079,7 @@ void main() {
|
||||
SemanticsFlag.isButton,
|
||||
SemanticsFlag.isEnabled,
|
||||
SemanticsFlag.hasEnabledState,
|
||||
SemanticsFlag.hasToggledState,
|
||||
SemanticsFlag.hasCheckedState,
|
||||
SemanticsFlag.isFocusable,
|
||||
],
|
||||
actions: <SemanticsAction>[
|
||||
@@ -2091,8 +2091,8 @@ void main() {
|
||||
SemanticsFlag.isButton,
|
||||
SemanticsFlag.isEnabled,
|
||||
SemanticsFlag.hasEnabledState,
|
||||
SemanticsFlag.isToggled,
|
||||
SemanticsFlag.hasToggledState,
|
||||
SemanticsFlag.isChecked,
|
||||
SemanticsFlag.hasCheckedState,
|
||||
SemanticsFlag.isFocusable,
|
||||
],
|
||||
actions: <SemanticsAction>[
|
||||
|
||||
Reference in New Issue
Block a user