diff --git a/packages/flutter/lib/src/material/bottom_navigation_bar.dart b/packages/flutter/lib/src/material/bottom_navigation_bar.dart index 0f9cf05692..6e78778812 100644 --- a/packages/flutter/lib/src/material/bottom_navigation_bar.dart +++ b/packages/flutter/lib/src/material/bottom_navigation_bar.dart @@ -605,6 +605,7 @@ class _BottomNavigationTile extends StatelessWidget { result = Semantics( selected: selected, + button: true, container: true, child: Stack( children: [ diff --git a/packages/flutter/test/material/bottom_navigation_bar_test.dart b/packages/flutter/test/material/bottom_navigation_bar_test.dart index f0e65837bb..ea25635457 100644 --- a/packages/flutter/test/material/bottom_navigation_bar_test.dart +++ b/packages/flutter/test/material/bottom_navigation_bar_test.dart @@ -2108,6 +2108,7 @@ void main() { matchesSemantics( label: 'AC\nTab 1 of 3', textDirection: TextDirection.ltr, + isButton: true, isFocusable: true, isSelected: true, hasTapAction: true, @@ -2119,6 +2120,7 @@ void main() { matchesSemantics( label: 'Alarm\nTab 2 of 3', textDirection: TextDirection.ltr, + isButton: true, isFocusable: true, hasTapAction: true, hasFocusAction: true, @@ -2129,6 +2131,7 @@ void main() { matchesSemantics( label: 'Hot Tub\nTab 3 of 3', textDirection: TextDirection.ltr, + isButton: true, isFocusable: true, hasTapAction: true, hasFocusAction: true, @@ -2165,6 +2168,7 @@ void main() { matchesSemantics( label: 'AC\nTab 1 of 3', textDirection: TextDirection.ltr, + isButton: true, isFocusable: true, isSelected: true, hasTapAction: true, @@ -2176,6 +2180,7 @@ void main() { matchesSemantics( label: 'Alarm\nTab 2 of 3', textDirection: TextDirection.ltr, + isButton: true, isFocusable: true, hasTapAction: true, hasFocusAction: true, @@ -2186,6 +2191,7 @@ void main() { matchesSemantics( label: 'Hot Tub\nTab 3 of 3', textDirection: TextDirection.ltr, + isButton: true, isFocusable: true, hasTapAction: true, hasFocusAction: true, @@ -2518,6 +2524,7 @@ void main() { matchesSemantics( label: 'Red\nTab 1 of 2', textDirection: TextDirection.ltr, + isButton: true, isFocusable: true, isSelected: true, hasTapAction: true, @@ -2529,6 +2536,7 @@ void main() { matchesSemantics( label: 'Green\nTab 2 of 2', textDirection: TextDirection.ltr, + isButton: true, isFocusable: true, hasTapAction: true, hasFocusAction: true, @@ -2563,6 +2571,7 @@ void main() { matchesSemantics( label: 'Red\nTab 1 of 2', textDirection: TextDirection.ltr, + isButton: true, isFocusable: true, isSelected: true, hasTapAction: true, @@ -2574,6 +2583,7 @@ void main() { matchesSemantics( label: 'Green\nTab 2 of 2', textDirection: TextDirection.ltr, + isButton: true, isFocusable: true, hasTapAction: true, hasFocusAction: true, @@ -2754,6 +2764,7 @@ void main() { children: [ TestSemantics( flags: [ + SemanticsFlag.isButton, SemanticsFlag.isSelected, SemanticsFlag.isFocusable, ], @@ -2762,7 +2773,10 @@ void main() { textDirection: TextDirection.ltr, ), TestSemantics( - flags: [SemanticsFlag.isFocusable], + flags: [ + SemanticsFlag.isButton, + SemanticsFlag.isFocusable, + ], actions: [SemanticsAction.tap, SemanticsAction.focus], label: 'B\nTab 2 of 2', textDirection: TextDirection.ltr,