Bottom Navigation Bar gradient icon in theme data

383 views Asked by At

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.

1

There are 1 answers

1
ABV On BEST ANSWER

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),
            ),
          ),