Skip to content

Commit 3e3f36d

Browse files
committed
bug with clipper fixed
1 parent aec1a4f commit 3e3f36d

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

lib/menu_navigations/header_navigation/header_navigation.dart

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff 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(

0 commit comments

Comments
 (0)