import 'package:driverapp/uitl/translations_delegate_base.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'bottom_navigation_item.dart'; class BottomNavBar extends StatefulWidget { final ValueChanged changeIndex; BottomNavBar({Key key, this.changeIndex}) : super(key: key); @override _BottomNavBarState createState() => _BottomNavBarState(); } class _BottomNavBarState extends State { int _index = 0; _changeIndex(int index) { widget.changeIndex(index); setState(() { _index = index; }); } @override Widget build(BuildContext context) { return BottomAppBar( elevation: 4, shape: CircularNotchedRectangle(), color: Colors.white, child: Padding( padding: EdgeInsets.symmetric(horizontal: 18), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ BottomNavigationItem( icon: EvaIcons.home, activeIcon: EvaIcons.home, changeIndex: _changeIndex, index: _index, currentIndex: 0, name: TranslationBase.of(context).home, ), BottomNavigationItem( icon: EvaIcons.list, activeIcon: EvaIcons.list, changeIndex: _changeIndex, index: _index, currentIndex: 1, name: TranslationBase.of(context).replay2, ), BottomNavigationItem( icon: EvaIcons.plus, activeIcon: EvaIcons.plus, changeIndex: _changeIndex, index: _index, currentIndex: 2, name: TranslationBase.of(context).booking, ), BottomNavigationItem( icon: EvaIcons.person, activeIcon: EvaIcons.person, changeIndex: _changeIndex, index: _index, currentIndex: 3, name: TranslationBase.of(context).mySchedule, ), BottomNavigationItem( icon: EvaIcons.calendar, activeIcon: EvaIcons.calendar, changeIndex: _changeIndex, index: _index, currentIndex: 4, name: TranslationBase.of(context).services, ) ], ), ), ); } }