diff --git a/packages/flutter/lib/src/cupertino/segmented_control.dart b/packages/flutter/lib/src/cupertino/segmented_control.dart index ca111c042a..1340a92473 100644 --- a/packages/flutter/lib/src/cupertino/segmented_control.dart +++ b/packages/flutter/lib/src/cupertino/segmented_control.dart @@ -313,6 +313,7 @@ class _SegmentedControlState extends State> child: new DefaultTextStyle( style: textStyle, child: new Semantics( + button: true, inMutuallyExclusiveGroup: true, selected: widget.groupValue == currentKey, child: child, diff --git a/packages/flutter/test/cupertino/segmented_control_test.dart b/packages/flutter/test/cupertino/segmented_control_test.dart index f168176aec..502724e059 100644 --- a/packages/flutter/test/cupertino/segmented_control_test.dart +++ b/packages/flutter/test/cupertino/segmented_control_test.dart @@ -606,6 +606,7 @@ void main() { new TestSemantics.rootChild( label: 'Child 1', flags: [ + SemanticsFlag.isButton, SemanticsFlag.isInMutuallyExclusiveGroup, SemanticsFlag.isSelected, ], @@ -616,6 +617,7 @@ void main() { new TestSemantics.rootChild( label: 'Child 2', flags: [ + SemanticsFlag.isButton, SemanticsFlag.isInMutuallyExclusiveGroup, ], actions: [ @@ -640,6 +642,7 @@ void main() { new TestSemantics.rootChild( label: 'Child 1', flags: [ + SemanticsFlag.isButton, SemanticsFlag.isInMutuallyExclusiveGroup, ], actions: [ @@ -649,6 +652,7 @@ void main() { new TestSemantics.rootChild( label: 'Child 2', flags: [ + SemanticsFlag.isButton, SemanticsFlag.isInMutuallyExclusiveGroup, SemanticsFlag.isSelected, ],