Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
7ce8f4ab
Unverified
Commit
7ce8f4ab
authored
Dec 16, 2020
by
Yash Johri
Committed by
GitHub
Dec 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Accessibility: repeated label on BottomNavigationBar fixed (#71587)
parent
ea7017d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
0 deletions
+74
-0
bottom_navigation_bar.dart
packages/flutter/lib/src/material/bottom_navigation_bar.dart
+1
-0
bottom_navigation_bar_test.dart
...ges/flutter/test/material/bottom_navigation_bar_test.dart
+73
-0
No files found.
packages/flutter/lib/src/material/bottom_navigation_bar.dart
View file @
7ce8f4ab
...
...
@@ -492,6 +492,7 @@ class _BottomNavigationTile extends StatelessWidget {
message:
item
.
label
!,
preferBelow:
false
,
verticalOffset:
selectedIconSize
+
selectedFontSize
,
excludeFromSemantics:
true
,
child:
result
,
);
}
...
...
packages/flutter/test/material/bottom_navigation_bar_test.dart
View file @
7ce8f4ab
...
...
@@ -10,6 +10,7 @@ import 'package:flutter_test/flutter_test.dart';
import
'package:vector_math/vector_math_64.dart'
show
Vector3
;
import
'../rendering/mock_canvas.dart'
;
import
'../widgets/semantics_tester.dart'
;
void
main
(
)
{
testWidgets
(
'BottomNavigationBar callback test'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -1786,6 +1787,78 @@ void main() {
expect
(
RendererBinding
.
instance
!.
mouseTracker
.
debugDeviceActiveCursor
(
1
),
SystemMouseCursors
.
click
);
});
testWidgets
(
'BottomNavigationBar excludes semantics'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Scaffold
(
bottomNavigationBar:
BottomNavigationBar
(
items:
const
<
BottomNavigationBarItem
>[
BottomNavigationBarItem
(
label:
'A'
,
icon:
Icon
(
Icons
.
ac_unit
),
),
BottomNavigationBarItem
(
label:
'B'
,
icon:
Icon
(
Icons
.
battery_alert
),
),
],
),
),
),
);
expect
(
semantics
,
hasSemantics
(
TestSemantics
.
root
(
children:
<
TestSemantics
>[
TestSemantics
(
textDirection:
TextDirection
.
ltr
,
children:
<
TestSemantics
>[
TestSemantics
(
children:
<
TestSemantics
>[
TestSemantics
(
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
scopesRoute
],
children:
<
TestSemantics
>[
TestSemantics
(
children:
<
TestSemantics
>[
TestSemantics
(
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isSelected
,
SemanticsFlag
.
isFocusable
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
label:
'A
\n
Tab 1 of 2'
,
textDirection:
TextDirection
.
ltr
,
),
TestSemantics
(
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isFocusable
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
label:
'B
\n
Tab 2 of 2'
,
textDirection:
TextDirection
.
ltr
,
),
],
),
],
),
],
),
],
),
],
),
ignoreId:
true
,
ignoreRect:
true
,
ignoreTransform:
true
,
),
);
semantics
.
dispose
();
});
}
Widget
boilerplate
(
{
Widget
?
bottomNavigationBar
,
required
TextDirection
textDirection
})
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment