|
|
|
@ -1,9 +1,10 @@
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter/widgets.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
import '../../config/size_config.dart';
|
|
|
|
@ -28,6 +29,7 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
|
bool _isInit = true;
|
|
|
|
|
Helpers helpers = new Helpers();
|
|
|
|
|
ProjectViewModel projectsProvider;
|
|
|
|
|
|
|
|
|
|
// @override
|
|
|
|
|
// void didChangeDependencies() {
|
|
|
|
|
// super.didChangeDependencies();
|
|
|
|
@ -47,119 +49,126 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
|
// margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 2),
|
|
|
|
|
child: Drawer(
|
|
|
|
|
child: Column(children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 4,
|
|
|
|
|
child: ListView(padding: EdgeInsets.zero, children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
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,
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 4,
|
|
|
|
|
child: ListView(padding: EdgeInsets.zero, children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
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: 15),
|
|
|
|
|
authProvider.doctorProfile != null
|
|
|
|
|
? CircleAvatar(
|
|
|
|
|
radius: SizeConfig.imageSizeMultiplier * 12,
|
|
|
|
|
backgroundImage: NetworkImage(
|
|
|
|
|
authProvider.doctorProfile.doctorImageURL),
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
)
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
authProvider.doctorProfile != null
|
|
|
|
|
? Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 10),
|
|
|
|
|
child: AppText(
|
|
|
|
|
authProvider.doctorProfile?.doctorName,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
|
|
|
|
))
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
AppText(
|
|
|
|
|
projectsProvider.isArabic
|
|
|
|
|
? authProvider
|
|
|
|
|
.doctorProfile.titleDescriptionN ??
|
|
|
|
|
""
|
|
|
|
|
: authProvider
|
|
|
|
|
.doctorProfile?.titleDescription ??
|
|
|
|
|
"",
|
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
|
color: Colors.black87),
|
|
|
|
|
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();
|
|
|
|
|
},
|
|
|
|
|
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,
|
|
|
|
|
backgroundImage: NetworkImage(
|
|
|
|
|
authProvider.doctorProfile.doctorImageURL),
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
)
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
authProvider.doctorProfile != null
|
|
|
|
|
? Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 10),
|
|
|
|
|
child: AppText(
|
|
|
|
|
authProvider.doctorProfile?.doctorName,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
|
|
|
|
))
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
AppText(
|
|
|
|
|
projectsProvider.isArabic
|
|
|
|
|
? authProvider
|
|
|
|
|
.doctorProfile.titleDescriptionN ??
|
|
|
|
|
""
|
|
|
|
|
: authProvider
|
|
|
|
|
.doctorProfile?.titleDescription ??
|
|
|
|
|
"",
|
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
|
color: Colors.black87),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
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();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
//Navigator.of(context).pushNamed(PROFILE);
|
|
|
|
|
Navigator.of(context).pushNamed(PROFILE, arguments: {
|
|
|
|
|
'title': authProvider.doctorProfile.doctorName,
|
|
|
|
|
"doctorProfileall": authProvider.doctorProfile
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
child: DrawerItem(
|
|
|
|
|
TranslationBase.of(context).settings, Icons.settings),
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.of(context).pushNamed(SETTINGS);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
child: DrawerItem(
|
|
|
|
|
TranslationBase.of(context).qr +
|
|
|
|
|
TranslationBase.of(context).reader,
|
|
|
|
|
DoctorApp.qr_code),
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.of(context).pushNamed(QR_READER);
|
|
|
|
|
},
|
|
|
|
|
InkWell(
|
|
|
|
|
child: DrawerItem(
|
|
|
|
|
TranslationBase.of(context).settings, Icons.settings),
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.of(context).pushNamed(SETTINGS);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
child: DrawerItem(
|
|
|
|
|
TranslationBase.of(context).qr +
|
|
|
|
|
TranslationBase.of(context).reader,
|
|
|
|
|
DoctorApp.qr_code),
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.of(context).pushNamed(QR_READER);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Column(children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
// This align moves the children to the bottom
|
|
|
|
|
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,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
))))
|
|
|
|
|
]))
|
|
|
|
|
])),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Column(children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
// This align moves the children to the bottom
|
|
|
|
|
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,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
))))
|
|
|
|
|
]))
|
|
|
|
|
])),
|
|
|
|
|
),
|
|
|
|
|
width: SizeConfig.realScreenWidth * 0.60,
|
|
|
|
|
margin: 0,
|
|
|
|
|