change bottom bar navigation

merge-requests/100/head
Mohammad ALjammal 6 years ago
parent 55de147885
commit 6d8289a0d4

@ -0,0 +1,98 @@
import 'package:doctor_app_flutter/screens/dashboard_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/message_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/services_screen.dart';
import 'package:doctor_app_flutter/widgets/shared/app_drawer_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.dart';
import 'package:doctor_app_flutter/widgets/shared/profile_image_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class LandingPage extends StatefulWidget {
@override
_LandingPageState createState() => _LandingPageState();
}
class _LandingPageState extends State<LandingPage> {
int currentTab = 0;
PageController pageController;
_changeCurrentTab(int tab) {
setState(() {
currentTab = tab;
pageController.jumpToPage(tab);
});
}
@override
void initState() {
super.initState();
pageController = new PageController(keepPage: true);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 0,
backgroundColor: Hexcolor('#515B5D'),
textTheme: TextTheme(
headline6: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)),
title: Text(getText(currentTab).toUpperCase()),
leading: Builder(
builder: (BuildContext context) {
return IconButton(
icon: Icon(Icons.menu),
color: Colors.white,
onPressed: () => Scaffold.of(context).openDrawer(),
);
},
),
centerTitle: true,
actions: <Widget>[
ProfileImageWidget(
height: 50,
width: 50,
url:
"https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png",
)
],
),
drawer: Theme(
data: Theme.of(context).copyWith(
canvasColor: Colors.transparent,
),
child: SafeArea(child: AppDrawer()),
),
extendBody: true,
body: PageView(
physics: NeverScrollableScrollPhysics(),
controller: pageController,
children: [
DashboardScreen(),
MessagesScreen(),
MyScheduleScreen(),
ServicesScreen()
],
),
bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab),
);
}
getText(currentTab) {
switch (currentTab) {
case 0:
return "HOME";
case 1:
return "REPLAY";
case 2:
return "SCHEDULE";
case 3:
return 'SERVICES';
}
}
}

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/providers/project_provider.dart'; import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/providers/schedule_provider.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
@ -26,7 +27,8 @@ class MyApp extends StatelessWidget {
ChangeNotifierProvider<PatientsProvider>(create: (context) => PatientsProvider()), ChangeNotifierProvider<PatientsProvider>(create: (context) => PatientsProvider()),
ChangeNotifierProvider<AuthProvider>(create: (context) => AuthProvider()), ChangeNotifierProvider<AuthProvider>(create: (context) => AuthProvider()),
ChangeNotifierProvider<HospitalProvider>(create: (context) => HospitalProvider()), ChangeNotifierProvider<HospitalProvider>(create: (context) => HospitalProvider()),
ChangeNotifierProvider<ProjectProvider>(create: (context) => ProjectProvider(),) ChangeNotifierProvider<ProjectProvider>(create: (context) => ProjectProvider(),),
ChangeNotifierProvider<ScheduleProvider>(create: (context) => ScheduleProvider(),)
], ],
child: Consumer<ProjectProvider>( child: Consumer<ProjectProvider>(
builder: (context,projectProvider,child) => MaterialApp( builder: (context,projectProvider,child) => MaterialApp(
@ -47,7 +49,7 @@ class MyApp extends StatelessWidget {
primaryColor: Colors.grey, primaryColor: Colors.grey,
buttonColor: Hexcolor('#B8382C'), buttonColor: Hexcolor('#B8382C'),
fontFamily: 'WorkSans', fontFamily: 'WorkSans',
dividerColor: Colors.grey[200], dividerColor: Colors.grey[350],
backgroundColor: Color.fromRGBO(255,255,255, 1) backgroundColor: Color.fromRGBO(255,255,255, 1)
), ),
initialRoute: INIT_ROUTE, initialRoute: INIT_ROUTE,

@ -26,6 +26,7 @@ import './screens/patients/profile/vital_sign/vital_sign_item_details_screen.dar
import './screens/patients/profile/vital_sign/vital_sign_screen.dart'; import './screens/patients/profile/vital_sign/vital_sign_screen.dart';
import './screens/profile_screen.dart'; import './screens/profile_screen.dart';
import './screens/settings/settings_screen.dart'; import './screens/settings/settings_screen.dart';
import 'landing_page.dart';
import 'screens/doctor/doctor_reply_screen.dart'; import 'screens/doctor/doctor_reply_screen.dart';
const String INIT_ROUTE = LOGIN; const String INIT_ROUTE = LOGIN;
@ -59,7 +60,7 @@ const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details';
const String BODY_MEASUREMENTS = 'patients/body-measurements'; const String BODY_MEASUREMENTS = 'patients/body-measurements';
var routes = { var routes = {
HOME: (_) => DashboardScreen(), HOME: (_) => LandingPage(),
LOGIN: (_) => Loginsreen(), LOGIN: (_) => Loginsreen(),
PROFILE: (_) => ProfileScreen(), PROFILE: (_) => ProfileScreen(),
MY_SCHEDULE: (_) => MyScheduleScreen(), MY_SCHEDULE: (_) => MyScheduleScreen(),

@ -7,10 +7,8 @@ import '../../widgets/auth/change_password.dart';
class ChangePasswordScreen extends StatelessWidget { class ChangePasswordScreen extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// return Container()];
return AppScaffold( return AppScaffold(
pageOnly: true,
body: SafeArea( body: SafeArea(
child: ListView(children: <Widget>[ child: ListView(children: <Widget>[
Container( Container(

@ -57,8 +57,7 @@ class _LoginsreenState extends State<Loginsreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
getSharedPref(); getSharedPref();
return AppScaffold( return AppScaffold(
pageOnly: true, isLoading: _isLoading,
isloading: _isLoading,
body: SafeArea( body: SafeArea(
child: ListView(children: <Widget>[ child: ListView(children: <Widget>[
FutureBuilder( FutureBuilder(

@ -37,8 +37,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
pageOnly: true, isLoading: _isLoading,
isloading: _isLoading,
body: ListView(children: <Widget>[ body: ListView(children: <Widget>[
Container( Container(
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),

@ -30,8 +30,7 @@ class _VerifyAccountScreenState extends State<VerifyAccountScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
// return Container()]; // return Container()];
return AppScaffold( return AppScaffold(
isloading: _isLoading, isLoading: _isLoading,
pageOnly: true,
body: SafeArea( body: SafeArea(
child: ListView(children: <Widget>[ child: ListView(children: <Widget>[
Container( Container(

@ -33,14 +33,14 @@ class DashboardScreen extends StatefulWidget {
class _DashboardScreenState extends State<DashboardScreen> { class _DashboardScreenState extends State<DashboardScreen> {
HospitalProvider projectsProvider; HospitalProvider projectsProvider;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);
return AppScaffold( return SafeArea(
appBarTitle: TranslationBase.of(context).dashboardScreenToolbarTitle, bottom: true,
current: 0, child: Scaffold(
body: Container( body: SingleChildScrollView(
child: new SingleChildScrollView(
child: SizedBox( child: SizedBox(
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
child: Column( child: Column(
@ -99,13 +99,13 @@ class _DashboardScreenState extends State<DashboardScreen> {
flex: 1, flex: 1,
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.stretch, CrossAxisAlignment.stretch,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: DashboardItemTexts( child: DashboardItemTexts(
"Arrived", "Arrived",
"23", "23",
)), )),
Expanded( Expanded(
child: DashboardItemTexts( child: DashboardItemTexts(
"Not Arrived", "Not Arrived",
@ -117,21 +117,21 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.stretch, CrossAxisAlignment.stretch,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: DashboardItemTexts( child: DashboardItemTexts(
"ER", "ER",
"23", "23",
)), )),
Expanded( Expanded(
child: DashboardItemTexts( child: DashboardItemTexts(
"Walk-in", "Walk-in",
"23", "23",
)),
],
)), )),
],
)),
], ],
), ),
)) ))
@ -376,7 +376,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
// , // ,
//constraints: new BoxConstraints(), //constraints: new BoxConstraints(),
), ),
))); ),
),
);
// Container( // Container(

@ -31,7 +31,6 @@ class DoctorReplyScreen extends StatelessWidget {
_doctorReplyProvider = Provider.of(context); _doctorReplyProvider = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).doctorReply, appBarTitle: TranslationBase.of(context).doctorReply,
showAppDrawer: false,
body:_doctorReplyProvider.isLoading? DrAppCircularProgressIndeicator(): body:_doctorReplyProvider.isLoading? DrAppCircularProgressIndeicator():
_doctorReplyProvider.isError? Center( _doctorReplyProvider.isError? Center(
child: Text( child: Text(

@ -5,9 +5,7 @@ import 'package:flutter/material.dart';
class MessagesScreen extends StatelessWidget { class MessagesScreen extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return Scaffold(
current: 1,
appBarTitle: TranslationBase.of(context).messagesScreenToolbarTitle,
body: Center( body: Center(
child: Text('Messages heeer'), child: Text('Messages heeer'),
), ),

@ -17,8 +17,6 @@ class MyReferralPatient extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
referralPatientProvider = Provider.of(context); referralPatientProvider = Provider.of(context);
return AppScaffold( return AppScaffold(
showBottomBar: false,
showAppDrawer: false,
appBarTitle: 'My Referral Patient', appBarTitle: 'My Referral Patient',
body: referralPatientProvider.isLoading body: referralPatientProvider.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()

@ -18,8 +18,6 @@ class MyReferredPatient extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
referredPatientProvider = Provider.of(context); referredPatientProvider = Provider.of(context);
return AppScaffold( return AppScaffold(
showBottomBar: false,
showAppDrawer: false,
appBarTitle: 'My Referred Patient', appBarTitle: 'My Referred Patient',
body: referredPatientProvider.isLoading body: referredPatientProvider.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()

@ -15,11 +15,7 @@ class MyScheduleScreen extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
scheduleProvider = Provider.of(context); scheduleProvider = Provider.of(context);
return AppScaffold( return Scaffold(
// pageOnly: false,
showBottomBar: false,
showAppDrawer: false,
appBarTitle: TranslationBase.of(context).mySchedule,
body: scheduleProvider.isLoading body: scheduleProvider.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: scheduleProvider.isError : scheduleProvider.isError

@ -4,9 +4,7 @@ import 'package:flutter/material.dart';
class ServicesScreen extends StatelessWidget { class ServicesScreen extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return Scaffold(
current: 2,
appBarTitle: 'Services',
body: Center( body: Center(
child: Text('Services heeer'), child: Text('Services heeer'),
), ),

@ -113,8 +113,6 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: "SEARCH FOR PATIENT", appBarTitle: "SEARCH FOR PATIENT",
showBottomBar: false,
showAppDrawer: false,
body: ListView( body: ListView(
children: <Widget>[ children: <Widget>[
RoundedContainer( RoundedContainer(

@ -296,8 +296,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
PatientsProvider patientsProv = Provider.of<PatientsProvider>(context); PatientsProvider patientsProv = Provider.of<PatientsProvider>(context);
return AppScaffold( return AppScaffold(
showBottomBar: false,
showAppDrawer: false,
appBarTitle: patientTypetitle, appBarTitle: patientTypetitle,
body: _isLoading body: _isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()

@ -77,8 +77,6 @@ class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: "Insurance Approvals", appBarTitle: "Insurance Approvals",
showAppDrawer: false,
showBottomBar: false,
body: patientsProv.isLoading body: patientsProv.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: patientsProv.isError : patientsProv.isError

@ -73,8 +73,6 @@ class _LabOrdersScreenState extends State<LabOrdersScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: "Lab Orders", appBarTitle: "Lab Orders",
showAppDrawer: false,
showBottomBar: false,
body: patientsProv.isLoading body: patientsProv.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: patientsProv.isError : patientsProv.isError

@ -41,8 +41,6 @@ class _LabResultState extends State<LabResult> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: "Lab Orders", appBarTitle: "Lab Orders",
showAppDrawer: false,
showBottomBar: false,
body: patientsProv.isLoading body: patientsProv.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: patientsProv.isError : patientsProv.isError

@ -76,8 +76,6 @@ class _PatientsOrdersState extends State<PatientsOrdersScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: "Orders", appBarTitle: "Orders",
showAppDrawer: false,
showBottomBar: false,
body: patientsProv.isLoading body: patientsProv.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: patientsProv.isError : patientsProv.isError

@ -9,9 +9,6 @@ class PatientProfileScreen extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
// child: child,
showBottomBar: false,
showAppDrawer: false,
appBarTitle: 'Patient Profile', appBarTitle: 'Patient Profile',
body: PatientProfileWidget(), body: PatientProfileWidget(),
); );

@ -81,8 +81,6 @@ class _PrescriptionScreenState extends State<PrescriptionScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: "Prescriptions", appBarTitle: "Prescriptions",
showAppDrawer: false,
showBottomBar: false,
body: patientsProv.isLoading body: patientsProv.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: patientsProv.isError : patientsProv.isError

@ -76,8 +76,6 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: "Progress Note", appBarTitle: "Progress Note",
showAppDrawer: false,
showBottomBar: false,
body: patientsProv.isLoading body: patientsProv.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: patientsProv.isError : patientsProv.isError

@ -13,8 +13,6 @@ class RadiologyReportScreen extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: "Radiology Report", appBarTitle: "Radiology Report",
showAppDrawer: false,
showBottomBar: false,
body: Container( body: Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),

@ -76,8 +76,6 @@ class _RadiologyScreenState extends State<RadiologyScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: "Radiology", appBarTitle: "Radiology",
showAppDrawer: false,
showBottomBar: false,
body: patientsProv.isLoading body: patientsProv.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: patientsProv.isError : patientsProv.isError

@ -77,8 +77,6 @@ class _VitalSignScreenState extends State<VitalSignScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: "VITAL SIGN", appBarTitle: "VITAL SIGN",
showAppDrawer: false,
showBottomBar: false,
body: patientsProv.isLoading body: patientsProv.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: patientsProv.isError : patientsProv.isError

@ -10,63 +10,33 @@ import '../../widgets/shared/app_loader_widget.dart';
import '../../widgets/shared/custom_shape_clipper.dart'; import '../../widgets/shared/custom_shape_clipper.dart';
class AppScaffold extends StatelessWidget { class AppScaffold extends StatelessWidget {
bool pageOnly = false; String appBarTitle;
// bool showAll =
bool showAppBar = true;
bool showAppDrawer = true;
bool showBottomBar = true;
bool showbg = true;
bool showCurve = true;
String appBarTitle = '';
Widget body; Widget body;
bool isloading = false; bool isLoading;
int current;
//======
Color backGroundcolorhex=Colors.teal;//Hexcolor('#88b74093');//Hexcolor('#FCF7F7');
//======
AppScaffold( AppScaffold({this.appBarTitle ='', this.body, this.isLoading = false});
{this.pageOnly,
this.appBarTitle,
this.showAppBar,
this.showBottomBar,
this.showAppDrawer = true,
this.body,
this.showbg,
this.showCurve,
this.isloading = false,
this.current,
this.backGroundcolorhex
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor:Hexcolor('#F5F5F5'), backgroundColor: Hexcolor('#F5F5F5'),
// (pageOnly == true || showbg == false) ? null : Hexcolor('#FCF7F7'), appBar: appBarTitle != ''
appBar: (pageOnly == true || showAppBar == false) ? AppBar(
? null
: AppBar(
elevation: 0, elevation: 0,
backgroundColor:Hexcolor('#515B5D'), //Hexcolor('#FFDDD9'), backgroundColor: Hexcolor('#515B5D'),
textTheme: TextTheme( textTheme: TextTheme(
title: TextStyle( headline6: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold)),//Colors.black color: Colors.white, fontWeight: FontWeight.bold)),
title: Text(appBarTitle.toUpperCase()), title: Text(appBarTitle.toUpperCase()),
leading: Builder(builder: (BuildContext context) { leading: Builder(builder: (BuildContext context) {
return IconButton( return IconButton(
icon: showAppDrawer icon: Icon(Icons.arrow_back_ios),
? Icon(Icons.menu) color: Colors.white, //Colors.black,
: Icon(Icons.arrow_back_ios), onPressed: () => Navigator.pop(context),
color: Colors.white,//Colors.black,
onPressed: () => showAppDrawer
? Scaffold.of(context).openDrawer()
: Navigator.pop(context),
); );
}), }),
centerTitle: true, centerTitle: true,
actions: <Widget>[ actions: <Widget>[
// IconButton(icon: Icon(Icons.person), onPressed: null)
ProfileImageWidget( ProfileImageWidget(
height: 50, height: 50,
width: 50, width: 50,
@ -74,93 +44,12 @@ class AppScaffold extends StatelessWidget {
"https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png", "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png",
) )
], ],
), )
drawer: (pageOnly == true || showAppDrawer == false) : null,
? null body: Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]));
: Theme(
data: Theme.of(context).copyWith(
canvasColor: Colors.transparent,
),
child: SafeArea(child: AppDrawer()),
),
// ,
bottomNavigationBar: (pageOnly == true || showBottomBar == false)
? null
: BottomNavigationBar(
items: [
BottomNavigationBarItem(
icon: Icon(
Icons.home,
color: current == 0 ? Colors.red : Colors.grey,
),
title: Text(
'Home',
style: TextStyle(
color: current == 0 ? Colors.red : Colors.grey),
),
backgroundColor: Colors.green,
// activeIcon: Icon(DoctorApp.home_icon)
),
BottomNavigationBarItem(
icon: new Icon(
Icons.mail,
color: current == 1 ? Colors.red : Colors.grey,
),
title: new Text('Messages',
style: TextStyle(
color: current == 1 ? Colors.red : Colors.grey)),
// backgroundColor: current == 1?Colors.red:Colors.grey,
),
BottomNavigationBarItem(
icon: Icon(
Icons.apps,
color: current == 2 ? Colors.red : Colors.grey,
),
title: Text('Menu',
style: TextStyle(
color: current == 2 ? Colors.red : Colors.grey)),
)
],
onTap: (index) => navigatot(index, context),
),
body: (pageOnly == true || showCurve == false)
? Stack(children: <Widget>[body, buildAppLoaderWidget(isloading)])
: Stack(
children: <Widget>[
ClipPath(
clipper: CustomShapeClipper(),
child: Container(
height: SizeConfig.realScreenHeight * 0.40,
decoration:
BoxDecoration(color: Hexcolor('#F5F5F5')))),//Hexcolor('#FFDDD9')
Positioned(
// key: ,
// top: SizeConfig.realScreenHeight * 0.10,
child: body),
buildAppLoaderWidget(isloading)
],
));
} }
Widget buildAppLoaderWidget(bool isloading) { Widget buildAppLoaderWidget(bool isloading) {
return isloading ? AppLoaderWidget() : Container(); return isloading ? AppLoaderWidget() : Container();
} }
navigatot(index, context) {
print('index :${index} current : ${current}');
if (index != current) {
switch (index) {
case 0:
Navigator.of(context).pushReplacementNamed(HOME);
break;
case 1:
Navigator.of(context).pushReplacementNamed(MESSAGES);
break;
case 2:
Navigator.of(context).pushReplacementNamed(SERVICES);
break;
default:
}
}
}
} }

@ -0,0 +1,75 @@
import 'package:doctor_app_flutter/presentation/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',
)
],
),
),
);
}
}

@ -0,0 +1,68 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class BottomNavigationItem extends StatelessWidget {
final IconData icon;
final IconData activeIcon;
final ValueChanged<int> changeIndex;
final int index;
final int currentIndex;
final String name;
BottomNavigationItem(
{this.icon,
this.activeIcon,
this.changeIndex,
this.index,
this.currentIndex,
this.name});
@override
Widget build(BuildContext context) {
return Expanded(
child: SizedBox(
height: 70.0,
child: Material(
type: MaterialType.transparency,
child: InkWell(
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
onTap: () => changeIndex(currentIndex),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(height: 15,),
Container(
// decoration: BoxDecoration(boxShadow: [
// BoxShadow(
// color: currentIndex == index
// ? Color.fromRGBO(78, 62, 253, 0.4)
// : Color.fromRGBO(78, 62, 253, 0),
// blurRadius: 9.0,
// spreadRadius: -4.0,
// offset: Offset(0.0, 2.0))
// ]),
child: Icon(currentIndex == index ? activeIcon : icon,
/*color: currentIndex == index
? Theme.of(context).primaryColor
: Theme.of(context).dividerColor,*/
size: 22.0),
),
SizedBox(height: 5,),
Text(
name,
style: TextStyle(
color: currentIndex == index
? Theme.of(context).primaryColor
: Theme.of(context).dividerColor,
),
),
],
),
),
),
),
);
}
}
Loading…
Cancel
Save