What's the name of the Flutter widget that has icons below the screen and I can slide to right and left to change between these screens (Ex: Twitter main page)
I could create a Container
with a Row
and the Icons
and do this manually, but I suspect that already exists this widget on Flutter.
CodePudding user response:
this bottom navigation bar can be done using BottomNavigationBar
in the bottomNavigationBar
property on your Scaffold
:
bottomNavigationBar: BottomNavigationBar(
items: [
BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'),
BottomNavigationBarItem(
icon: Icon(Icons.business), label: 'Business'),
BottomNavigationBarItem(icon: Icon(Icons.school), label: 'School'),
],
),
and for the slidable pages can be done using a PageView
widget:
PageView(
children: <Widget>[
ScreenOne(),
ScreenTwo(),
ScreenThree(),
],
);
and you can link both of them when you click an item in the BottomNavigationBar
, it will navigate to a specific page with a PageController
.