|
|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
import 'package:doctor_app_flutter/routes.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
|
|
|
|
|
@ -18,6 +19,7 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
|
String appBarTitle = '';
|
|
|
|
|
Widget body;
|
|
|
|
|
bool isloading = false;
|
|
|
|
|
int current;
|
|
|
|
|
|
|
|
|
|
AppScaffold(
|
|
|
|
|
{this.pageOnly,
|
|
|
|
|
@ -28,7 +30,8 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
|
this.body,
|
|
|
|
|
this.showbg,
|
|
|
|
|
this.showCurve,
|
|
|
|
|
this.isloading = false});
|
|
|
|
|
this.isloading = false,
|
|
|
|
|
this.current});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
@ -46,9 +49,13 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
|
title: Text(appBarTitle.toUpperCase()),
|
|
|
|
|
leading: Builder(builder: (BuildContext context) {
|
|
|
|
|
return IconButton(
|
|
|
|
|
icon: showAppDrawer ? Icon(Icons.menu) : Icon(Icons.arrow_back_ios) ,
|
|
|
|
|
icon: showAppDrawer
|
|
|
|
|
? Icon(Icons.menu)
|
|
|
|
|
: Icon(Icons.arrow_back_ios),
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
onPressed: () => showAppDrawer? Scaffold.of(context).openDrawer() : Navigator.pop(context),
|
|
|
|
|
onPressed: () => showAppDrawer
|
|
|
|
|
? Scaffold.of(context).openDrawer()
|
|
|
|
|
: Navigator.pop(context),
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
centerTitle: true,
|
|
|
|
|
@ -67,19 +74,43 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
|
// ,
|
|
|
|
|
bottomNavigationBar: (pageOnly == true || showBottomBar == false)
|
|
|
|
|
? null
|
|
|
|
|
: BottomNavigationBar(items: [
|
|
|
|
|
: BottomNavigationBar(
|
|
|
|
|
items: [
|
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
|
icon: Icon(DoctorApp.home_icon),
|
|
|
|
|
title: Text('Home'),
|
|
|
|
|
backgroundColor: Colors.red,
|
|
|
|
|
activeIcon: Icon(Icons.home)),
|
|
|
|
|
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),
|
|
|
|
|
title: new Text('Messages'),
|
|
|
|
|
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), title: Text('Menu'))
|
|
|
|
|
]),
|
|
|
|
|
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(
|
|
|
|
|
@ -102,4 +133,22 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
|
Widget buildAppLoaderWidget(bool isloading) {
|
|
|
|
|
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:
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|