|
|
|
@ -31,14 +31,6 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
|
Helpers helpers = new Helpers();
|
|
|
|
|
ProjectViewModel projectsProvider;
|
|
|
|
|
|
|
|
|
|
// @override
|
|
|
|
|
// void didChangeDependencies() {
|
|
|
|
|
// super.didChangeDependencies();
|
|
|
|
|
// // if (_isInit) {
|
|
|
|
|
// getDocProfile(); // TODO: Refactor this code to prevent errors in the cosole.
|
|
|
|
|
// // }
|
|
|
|
|
// _isInit = false;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
@ -47,127 +39,112 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
|
return RoundedContainer(
|
|
|
|
|
child: Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
// margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 2),
|
|
|
|
|
child: Drawer(
|
|
|
|
|
child: Column(children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 4,
|
|
|
|
|
child: ListView(padding: EdgeInsets.zero, children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 20),
|
|
|
|
|
height: SizeConfig.heightMultiplier * 50,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
child: DrawerHeader(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
'assets/images/logo.png',
|
|
|
|
|
),
|
|
|
|
|
margin: EdgeInsets.only(top: 10, bottom: 15),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 1,
|
|
|
|
|
child: Container(
|
|
|
|
|
color: Colors.black26,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 15),
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.of(context)
|
|
|
|
|
.pushNamed(PROFILE, arguments: {
|
|
|
|
|
'title': authProvider.doctorProfile.doctorName,
|
|
|
|
|
"doctorProfileall": authProvider.doctorProfile
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
authProvider.doctorProfile != null
|
|
|
|
|
? CircleAvatar(
|
|
|
|
|
radius:
|
|
|
|
|
SizeConfig.imageSizeMultiplier * 12,
|
|
|
|
|
// radius: (52)
|
|
|
|
|
child: ClipRRect(
|
|
|
|
|
borderRadius: BorderRadius.circular(50),
|
|
|
|
|
child: Image.network(
|
|
|
|
|
authProvider
|
|
|
|
|
.doctorProfile.doctorImageURL,
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
width: 700,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
|
)
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
authProvider.doctorProfile != null
|
|
|
|
|
? Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 10),
|
|
|
|
|
child: AppText(
|
|
|
|
|
TranslationBase.of(context).dr +
|
|
|
|
|
authProvider
|
|
|
|
|
.doctorProfile?.doctorName,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
|
|
|
|
))
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
RaisedButton(
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(18.0),
|
|
|
|
|
side: BorderSide(color: Colors.red)),
|
|
|
|
|
child: AppText(
|
|
|
|
|
TranslationBase.of(context).logout,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
await helpers.logout();
|
|
|
|
|
projectsProvider.isLogin = false;
|
|
|
|
|
},
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
'assets/images/dr_app_logo.png',
|
|
|
|
|
),
|
|
|
|
|
margin: EdgeInsets.only(top: 10, bottom: 15),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 15),
|
|
|
|
|
if (authProvider.doctorProfile != null)
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.of(context).pushNamed(PROFILE, arguments: {
|
|
|
|
|
'title': authProvider.doctorProfile.doctorName,
|
|
|
|
|
"doctorProfileall": authProvider.doctorProfile
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 10),
|
|
|
|
|
child: AppText(
|
|
|
|
|
TranslationBase.of(context).dr +
|
|
|
|
|
authProvider.doctorProfile?.doctorName,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Color(0xFF2E303A),
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2.5,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 5),
|
|
|
|
|
child: AppText(
|
|
|
|
|
authProvider.doctorProfile?.clinicDescription,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: Color(0xFF2E303A),
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 15),
|
|
|
|
|
InkWell(
|
|
|
|
|
child: DrawerItem(
|
|
|
|
|
TranslationBase.of(context).rescheduleLeaves,
|
|
|
|
|
// " or " +
|
|
|
|
|
// TranslationBase.of(context).leaves,
|
|
|
|
|
|
|
|
|
|
DoctorApp.leaves,
|
|
|
|
|
// subTitle: ,
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => AddRescheduleLeavScreen(),
|
|
|
|
|
// MyReferredPatient(),
|
|
|
|
|
));
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
child: DrawerItem(
|
|
|
|
|
TranslationBase.of(context).settings, Icons.settings),
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.of(context).pushNamed(SETTINGS);
|
|
|
|
|
},
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 40,
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
child: DrawerItem(
|
|
|
|
|
TranslationBase.of(context).reschedule,
|
|
|
|
|
DoctorApp.leaves,
|
|
|
|
|
subTitle: TranslationBase.of(context).leaves,
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 20),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
InkWell(
|
|
|
|
|
child: DrawerItem(
|
|
|
|
|
TranslationBase.of(context).logout, Icons.settings),
|
|
|
|
|
onTap: () async {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
await helpers.logout();
|
|
|
|
|
projectsProvider.isLogin = false;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
child: DrawerItem(
|
|
|
|
|
projectsProvider.isArabic
|
|
|
|
|
? TranslationBase.of(context).lanEnglish
|
|
|
|
|
: TranslationBase.of(context).lanArabic,
|
|
|
|
|
DoctorApp.qr_code),
|
|
|
|
|
onTap: () {
|
|
|
|
|
if (projectsProvider.isArabic)
|
|
|
|
|
projectsProvider.changeLanguage('en');
|
|
|
|
|
else
|
|
|
|
|
projectsProvider.changeLanguage('ar');
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => AddRescheduleLeavScreen(),
|
|
|
|
|
// MyReferredPatient(),
|
|
|
|
|
));
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
child: DrawerItem(
|
|
|
|
|
TranslationBase.of(context).qr +
|
|
|
|
|
TranslationBase.of(context).reader,
|
|
|
|
|
DoctorApp.qr_code),
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.of(context).pushNamed(QR_READER);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
@ -179,14 +156,35 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
|
child: Align(
|
|
|
|
|
alignment: FractionalOffset.bottomCenter,
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Text("Powered by"),
|
|
|
|
|
Image.asset(
|
|
|
|
|
'assets/images/cs_logo_container.png',
|
|
|
|
|
width: SizeConfig.imageSizeMultiplier * 30,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width *0.3,
|
|
|
|
|
child: RichText(
|
|
|
|
|
text: TextSpan(
|
|
|
|
|
text: 'Powered by',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Color(0xFF989898),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
|
|
|
|
fontFamily: 'Poppins',),
|
|
|
|
|
children: <TextSpan>[
|
|
|
|
|
TextSpan(text: ' Cloud Solutions',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Color(0xFF2E303A),
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
|
|
|
|
fontFamily: 'Poppins',),
|
|
|
|
|
)
|
|
|
|
|
]
|
|
|
|
|
),),
|
|
|
|
|
),
|
|
|
|
|
// Text("Powered by"),
|
|
|
|
|
Image.asset(
|
|
|
|
|
'assets/images/cs_logo_container.png',
|
|
|
|
|
width: SizeConfig.imageSizeMultiplier * 20,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
))))
|
|
|
|
|
]))
|
|
|
|
|
])),
|
|
|
|
|