int _selectedIndex = 1; final _widgetOptions = [
Text('Index 0: Home'),
Text('Index 1: Business'),
Text('Index 2: School'),
];@override
Widget build(BuildContext context) {
return new Scaffold( appBar: new AppBar( backgroundColor: Colors.grey, bottom: new TabBar( controller: controller, tabs: [ new Tab(icon: new Icon(Icons.arrow_forward)), new Tab(icon: new Icon(Icons.arrow_downward)), new Tab(icon: new Icon(Icons.arrow_back)),
]
)
),
body: Center( child: _widgetOptions.elementAt(_selectedIndex),
), bottomNavigationBar: BottomNavigationBar( items: [
BottomNavigationBarItem(icon: Icon(Icons.home), title: Text('Home')),
BottomNavigationBarItem(icon: Icon(Icons.business), title: Text('Business')),
BottomNavigationBarItem(icon: Icon(Icons.school), title: Text('School')),
], currentIndex: _selectedIndex, fixedColor: Colors.deepPurple, onTap: _onItemTapped,
),
);
} void _onItemTapped(int index) {
setState(() {
_selectedIndex = index;
});
}