I was making a BottonNavigation bar in flutter dart and i am getting an error
the code is This the code
the error is And this the error pls help
I want a solution for this error if someone can help me i will thank them a lot
you need to pass NavigationDestination instead of NavigationDrawerDestination in the destinations params
** sample code snippet **
bottomNavigationBar: NavigationBar(
onDestinationSelected: (int index) {
setState(() {
currentPageIndex = index;
});
},
selectedIndex: currentPageIndex,
destinations: const <Widget>[
NavigationDestination(
icon: Icon(Icons.explore),
label: 'Explore',
),
NavigationDestination(
icon: Icon(Icons.commute),
label: 'Commute',
),
NavigationDestination(
selectedIcon: Icon(Icons.bookmark),
icon: Icon(Icons.bookmark_border),
label: 'Saved',
),
],
),
follow official documentation https://api.flutter.dev/flutter/material/NavigationBar-class.html (material you/3)
or If you are using other package for it check its documentation
or you can also use https://api.flutter.dev/flutter/material/BottomNavigationBar-class.html (material 2)