Closed superaldo closed 5 years ago
I have the same issue and is inside of a Stetefull widget, I put the BottomNavyBar in the bottom part of the Appbar using PreferredSize, and when the app is loaded the navigation item is not selected by default.
bottom: PreferredSize( preferredSize: Size(0,40), child: BottomNavyBar( onItemSelected: (index) => setState(() { _index = index; _controllerTab.animateTo(_index); }), items: [ BottomNavyBarItem( icon: Icon(Icons.chrome_reader_mode), title: Text('Referendum'), activeColor: Colors.red, inactiveColor: Colors.grey, ), BottomNavyBarItem( icon: Icon(Icons.people), title: Text('Pagar'), activeColor: Colors.green, inactiveColor: Colors.grey ), BottomNavyBarItem( icon: Icon(Icons.message), title: Text('Derechos'), activeColor: Colors.deepPurple, inactiveColor: Colors.grey, ), BottomNavyBarItem( icon: Icon(Icons.settings), title: Text('Notificaciones'), activeColor: Colors.blue, inactiveColor: Colors.grey, ), ], ), ),
Did you find the right way?
Looks like you have not implemented the selectedIndex property. I'll close this for now feel free to re-open it again if neccessary
selectedIndex
I have the same issue and is inside of a Stetefull widget, I put the BottomNavyBar in the bottom part of the Appbar using PreferredSize, and when the app is loaded the navigation item is not selected by default.