import 'package:car_for_her/config/palette.dart'; import 'package:car_for_her/views/driver/home.dart'; import 'package:car_for_her/views/driver/profile.dart'; import 'package:car_for_her/views/driver/wallet.dart'; import 'package:flutter/material.dart'; class DriverBottomNavigator extends StatefulWidget { const DriverBottomNavigator({Key key}) : super(key: key); @override _DriverBottomNavigatorState createState() => _DriverBottomNavigatorState(); } class _DriverBottomNavigatorState extends State { int currentIndex = 0; final screen = [ DriverHome(), DriverWallet(), DriverProfile(), ]; @override Widget build(BuildContext context) { return Scaffold( body: IndexedStack( index: currentIndex, children: screen, ), bottomNavigationBar: Container( height: 80, decoration: BoxDecoration( borderRadius: BorderRadius.only( topRight: Radius.circular(30), topLeft: Radius.circular(30)), boxShadow: [ BoxShadow(color: Colors.black38, spreadRadius: 0, blurRadius: 10), ], ), child: ClipRRect( borderRadius: BorderRadius.only( topRight: Radius.circular(30), topLeft: Radius.circular(30)), child: BottomNavigationBar( type: BottomNavigationBarType.fixed, selectedItemColor: Palette.primary, iconSize: 30, showUnselectedLabels: false, showSelectedLabels: false, currentIndex: currentIndex, onTap: (index) { setState(() { currentIndex = index; }); }, items: [ BottomNavigationBarItem( icon: Icon(Icons.home_rounded), label: 'Home', ), BottomNavigationBarItem( icon: Icon(Icons.account_balance_wallet), label: 'Wallet', ), BottomNavigationBarItem( icon: Icon(Icons.person_rounded), label: 'Profile', ), ], ), ), ), ); } }