File tree Expand file tree Collapse file tree 1 file changed +20
-12
lines changed Expand file tree Collapse file tree 1 file changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,13 @@ class HeaderNavigation extends StatefulWidget {
1919 final List <HeaderNavigationItem > items;
2020 final Duration duration;
2121
22- const HeaderNavigation (
23- {Key key,
24- @required this .items,
25- this .duration = const Duration (milliseconds: 400 )})
26- : super (key: key);
22+ const HeaderNavigation ({
23+ Key key,
24+ @required this .items,
25+ this .duration = const Duration (
26+ milliseconds: 400 ,
27+ ),
28+ }) : super (key: key);
2729
2830 @override
2931 _HeaderNavigationState createState () => _HeaderNavigationState ();
@@ -38,6 +40,7 @@ class _HeaderNavigationState extends State<HeaderNavigation> {
3840 void _onItemTapped (int index) {
3941 if (! _open) {
4042 setState (() {
43+ _currentIndex = index;
4144 _open = true ;
4245 });
4346 return ;
@@ -103,13 +106,18 @@ class _HeaderNavigationState extends State<HeaderNavigation> {
103106 if (_open)
104107 Expanded (
105108 flex: 2 ,
106- child: ShaderMask (
107- shaderCallback: (bounds) => LinearGradient (
108- colors: [item.colorForeground, item.colorForeground],
109- tileMode: TileMode .mirror,
110- ).createShader (bounds),
111- blendMode: BlendMode .srcIn,
112- child: item.icon,
109+ child: ClipRect (
110+ child: ShaderMask (
111+ shaderCallback: (bounds) => LinearGradient (
112+ colors: [
113+ item.colorForeground,
114+ item.colorForeground
115+ ],
116+ tileMode: TileMode .mirror,
117+ ).createShader (bounds),
118+ blendMode: BlendMode .srcIn,
119+ child: item.icon,
120+ ),
113121 ),
114122 ),
115123 Expanded (
You can’t perform that action at this time.
0 commit comments