I have a bottom navigation bar to navigate between classes in the same screen
my main build widget:
Widget build(BuildContext context) {
return SafeArea(
top: false,
child: Scaffold(
body: PageStorage(
child: Stack(
children: <Widget>[currentPage, bottomBar()],
),
bucket: bucket,
),
),
);
}
my bottom bar
Widget bottomBar() {
return Column(
children: <Widget>[
const Expanded(
child: SizedBox(),
),
BottomBarView(
tabIconsList: tabIconsList,
addClick: () {},
changeIndex: (int index) {
setState(() {
currentTab = index;
currentPage = pages[index];
print(pages[index]);
print(currentTab);
});
},
),
],
);
}
The bottom bar is working properly but it every time I press a button it rebuilds the same class over and over again even though I'm using bucket and PageStoorage How can I stop rebuilding classes?