You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
2.1 KiB
Dart
76 lines
2.1 KiB
Dart
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'bottom_navigation_item.dart';
|
|
|
|
class BottomNavBar extends StatefulWidget {
|
|
final ValueChanged<int> changeIndex;
|
|
|
|
BottomNavBar({Key key, this.changeIndex}) : super(key: key);
|
|
|
|
@override
|
|
_BottomNavBarState createState() => _BottomNavBarState();
|
|
}
|
|
|
|
class _BottomNavBarState extends State<BottomNavBar> {
|
|
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: DoctorApp.home_icon,
|
|
activeIcon: DoctorApp.home_icon_active,
|
|
changeIndex: _changeIndex,
|
|
index: _index,
|
|
currentIndex: 0,
|
|
name: 'HOME',
|
|
),
|
|
BottomNavigationItem(
|
|
icon: DoctorApp.message_icon,
|
|
activeIcon: DoctorApp.message_icon_active,
|
|
changeIndex: _changeIndex,
|
|
index: _index,
|
|
currentIndex: 1,
|
|
name: 'REPLAY',
|
|
),
|
|
BottomNavigationItem(
|
|
icon: DoctorApp.schedule_icon,
|
|
activeIcon: DoctorApp.scdedule_icon_active,
|
|
changeIndex: _changeIndex,
|
|
index: _index,
|
|
currentIndex: 2,
|
|
name: 'SCHEDULE',
|
|
),
|
|
BottomNavigationItem(
|
|
icon: DoctorApp.menu_icon,
|
|
activeIcon: DoctorApp.menu_icon_active,
|
|
changeIndex: _changeIndex,
|
|
index: _index,
|
|
currentIndex: 3,
|
|
name: 'SERVICES',
|
|
)
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|