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.
59 lines
1.8 KiB
Dart
59 lines
1.8 KiB
Dart
import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
|
|
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
|
|
import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
|
|
import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart';
|
|
import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart';
|
|
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
|
|
|
|
class H20BottomNavigationBar extends StatelessWidget {
|
|
H20BottomNavigationBar({Key key}) : super(key: key);
|
|
|
|
PageController pageController = PageController(keepPage: true);
|
|
int currentTab = 0;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
// TODO: implement build
|
|
return Scaffold(
|
|
body: PageView(
|
|
physics: NeverScrollableScrollPhysics(),
|
|
controller: pageController,
|
|
children: [
|
|
HomePage(
|
|
goToMyProfile: () {
|
|
_changeCurrentTab(1);
|
|
},
|
|
),
|
|
MedicalProfilePage(),
|
|
BookingOptions(),
|
|
MyFamily(isAppbarVisible: false),
|
|
ToDo(isShowAppBar: false),
|
|
], // Please do not remove the BookingOptions from this array
|
|
),
|
|
bottomNavigationBar: BottomNavBar(
|
|
changeIndex: _changeCurrentTab,
|
|
index: currentTab,
|
|
),
|
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
|
floatingActionButton: FloatingButton(
|
|
elevation: true,
|
|
onTap: () {
|
|
_changeCurrentTab(2);
|
|
}),
|
|
);
|
|
}
|
|
|
|
_changeCurrentTab(int tab) {
|
|
// setState(() {
|
|
currentTab = tab;
|
|
if (tab != 0)
|
|
pageController.jumpToPage(tab);
|
|
else {
|
|
pageController.jumpToPage(tab);
|
|
}
|
|
// });
|
|
}
|
|
}
|