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
1b671127
Unverified
Commit
1b671127
authored
Apr 29, 2020
by
Anthony
Committed by
GitHub
Apr 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix default opacity assignments for unselected and selected icons in NavigationRail (#55902)
parent
4dd3435b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
navigation_rail.dart
packages/flutter/lib/src/material/navigation_rail.dart
+4
-4
navigation_rail_theme_test.dart
...ges/flutter/test/material/navigation_rail_theme_test.dart
+2
-2
No files found.
packages/flutter/lib/src/material/navigation_rail.dart
View file @
1b671127
...
...
@@ -441,20 +441,20 @@ class _NavigationRailState extends State<NavigationRail> with TickerProviderStat
final
double
minWidth
=
widget
.
minWidth
??
_minRailWidth
;
final
double
minExtendedWidth
=
widget
.
minExtendedWidth
??
_minExtendedRailWidth
;
final
Color
baseSelectedColor
=
theme
.
colorScheme
.
primary
;
final
Color
baseColor
=
theme
.
colorScheme
.
onSurface
.
withOpacity
(
0.64
);
final
Color
base
Unselected
Color
=
theme
.
colorScheme
.
onSurface
.
withOpacity
(
0.64
);
final
IconThemeData
defaultUnselectedIconTheme
=
widget
.
unselectedIconTheme
??
navigationRailTheme
.
unselectedIconTheme
;
final
IconThemeData
unselectedIconTheme
=
IconThemeData
(
size:
defaultUnselectedIconTheme
?.
size
??
24.0
,
color:
defaultUnselectedIconTheme
?.
color
??
theme
.
colorScheme
.
onSurface
,
opacity:
defaultUnselectedIconTheme
?.
opacity
??
1.0
,
opacity:
defaultUnselectedIconTheme
?.
opacity
??
0.64
,
);
final
IconThemeData
defaultSelectedIconTheme
=
widget
.
selectedIconTheme
??
navigationRailTheme
.
selectedIconTheme
;
final
IconThemeData
selectedIconTheme
=
IconThemeData
(
size:
defaultSelectedIconTheme
?.
size
??
24.0
,
color:
defaultSelectedIconTheme
?.
color
??
theme
.
colorScheme
.
primary
,
opacity:
defaultSelectedIconTheme
?.
opacity
??
0.64
,
opacity:
defaultSelectedIconTheme
?.
opacity
??
1.0
,
);
final
TextStyle
unselectedLabelTextStyle
=
theme
.
textTheme
.
bodyText1
.
copyWith
(
color:
baseColor
).
merge
(
widget
.
unselectedLabelTextStyle
??
navigationRailTheme
.
unselectedLabelTextStyle
);
final
TextStyle
unselectedLabelTextStyle
=
theme
.
textTheme
.
bodyText1
.
copyWith
(
color:
base
Unselected
Color
).
merge
(
widget
.
unselectedLabelTextStyle
??
navigationRailTheme
.
unselectedLabelTextStyle
);
final
TextStyle
selectedLabelTextStyle
=
theme
.
textTheme
.
bodyText1
.
copyWith
(
color:
baseSelectedColor
).
merge
(
widget
.
selectedLabelTextStyle
??
navigationRailTheme
.
selectedLabelTextStyle
);
final
double
groupAlignment
=
widget
.
groupAlignment
??
navigationRailTheme
.
groupAlignment
??
-
1.0
;
final
NavigationRailLabelType
labelType
=
widget
.
labelType
??
navigationRailTheme
.
labelType
??
NavigationRailLabelType
.
none
;
...
...
packages/flutter/test/material/navigation_rail_theme_test.dart
View file @
1b671127
...
...
@@ -29,10 +29,10 @@ void main() {
expect
(
_railMaterial
(
tester
).
elevation
,
0
);
expect
(
_selectedIconTheme
(
tester
).
size
,
24.0
);
expect
(
_selectedIconTheme
(
tester
).
color
,
ThemeData
().
colorScheme
.
primary
);
expect
(
_selectedIconTheme
(
tester
).
opacity
,
0.64
);
expect
(
_selectedIconTheme
(
tester
).
opacity
,
1.0
);
expect
(
_unselectedIconTheme
(
tester
).
size
,
24.0
);
expect
(
_unselectedIconTheme
(
tester
).
color
,
ThemeData
().
colorScheme
.
onSurface
);
expect
(
_unselectedIconTheme
(
tester
).
opacity
,
1.0
);
expect
(
_unselectedIconTheme
(
tester
).
opacity
,
0.64
);
expect
(
_selectedLabelStyle
(
tester
).
fontSize
,
14.0
);
expect
(
_unselectedLabelStyle
(
tester
).
fontSize
,
14.0
);
expect
(
_destinationsAlign
(
tester
).
alignment
,
Alignment
.
topCenter
);
...
...
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