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
d263cfbc
Unverified
Commit
d263cfbc
authored
Jul 21, 2022
by
Bruno Leroux
Committed by
GitHub
Jul 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix BottomNavigationBarItem tooltip defaults to label (#107715)
parent
ebb9128f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
7 deletions
+5
-7
bottom_navigation_bar.dart
packages/flutter/lib/src/material/bottom_navigation_bar.dart
+1
-1
bottom_navigation_bar_item.dart
...s/flutter/lib/src/widgets/bottom_navigation_bar_item.dart
+3
-5
bottom_navigation_bar_test.dart
...ges/flutter/test/material/bottom_navigation_bar_test.dart
+1
-1
No files found.
packages/flutter/lib/src/material/bottom_navigation_bar.dart
View file @
d263cfbc
...
...
@@ -455,7 +455,7 @@ class _BottomNavigationTile extends StatelessWidget {
final
double
unselectedIconDiff
=
math
.
max
(
unselectedIconSize
-
selectedIconSize
,
0
);
// The effective tool tip message to be shown on the BottomNavigationBarItem.
final
String
?
effectiveTooltip
=
item
.
tooltip
==
''
?
null
:
item
.
tooltip
??
item
.
label
;
final
String
?
effectiveTooltip
=
item
.
tooltip
==
''
?
null
:
item
.
tooltip
;
// Defines the padding for the animating icons + labels.
//
...
...
packages/flutter/lib/src/widgets/bottom_navigation_bar_item.dart
View file @
d263cfbc
...
...
@@ -81,12 +81,10 @@ class BottomNavigationBarItem {
/// the icons themselves.
final
Color
?
backgroundColor
;
/// The text to display in the tooltip for this [BottomNavigationBarItem], when
/// the user long presses the item.
/// The text to display in the [Tooltip] for this [BottomNavigationBarItem].
///
/// The [Tooltip] will only appear on an item in a Material design [BottomNavigationBar], and
/// when the string is not empty.
/// A [Tooltip] will only appear on this item if `tooltip` is set to a non-empty string.
///
/// Defaults to null, in which case the
[label] text will be used
.
/// Defaults to null, in which case the
tooltip is not shown
.
final
String
?
tooltip
;
}
packages/flutter/test/material/bottom_navigation_bar_test.dart
View file @
d263cfbc
...
...
@@ -1209,7 +1209,7 @@ void main() {
expect
(
find
.
text
(
'B'
),
findsOneWidget
);
await
tester
.
longPress
(
find
.
text
(
'B'
));
expect
(
find
.
byTooltip
(
'B'
),
finds
OneWidget
);
expect
(
find
.
byTooltip
(
'B'
),
finds
Nothing
);
expect
(
find
.
text
(
'C'
),
findsOneWidget
);
await
tester
.
longPress
(
find
.
text
(
'C'
));
...
...
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