Initiate State
abdollah3d opened this issue · 1 comments
abdollah3d commented
is it possible to start from a different index than the most left one?
like app does what this button do at start
ElevatedButton(
child: Text('Go To Page of index 2'),
onPressed: () {
final CurvedNavigationBarState? navBarState =
_bottomNavigationKey.currentState;
navBarState?.setPage(2);
},
)
rafalbednarczuk commented
Yes, use index
property of the widget.
Example:
CurvedNavigationBar(
key: _bottomNavigationKey,
index: 3,
items: <Widget>[
Icon(Icons.add, size: 30),
Icon(Icons.list, size: 30),
Icon(Icons.compare_arrows, size: 30),
Icon(Icons.call_split, size: 30),
Icon(Icons.perm_identity, size: 30),
],
color: Colors.white,
buttonBackgroundColor: Colors.white,
backgroundColor: Colors.blueAccent,
animationCurve: Curves.easeInOut,
animationDuration: Duration(milliseconds: 600),
onTap: (index) {
},
letIndexChange: (index) => true,
)
```