I want to use Linear Gradient icon in my bottom navigation bar for selected icon property can anybody tell me how to do it ! Thank You.
Asked
Active
Viewed 296 times
1 Answers
0
You can add the BottomNavigationBarItem Like as below.
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Home',
activeIcon: ShaderMask(
shaderCallback: (Rect bounds) {
return LinearGradient(
colors: <Color>[
Colors.red,
Colors.blue
],
tileMode: TileMode.repeated,
).createShader(bounds);
},
child: Icon(Icons.home),
),
),

ABV
- 857
- 2
- 3
-
Please set it answer if it works as expected. – ABV Jun 08 '22 at 14:45