Closed abdollah3d closed 5 months ago
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,
)
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); }, )