finish drawer

merge-requests/382/head
Elham Rababah 5 years ago
parent f78f178fd8
commit 8beab7d84f

@ -23,6 +23,7 @@ class MyScheduleWidget extends StatelessWidget {
children: [ children: [
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 10, height: 10,

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

@ -26,7 +26,7 @@ class _DrawerItemState extends State<DrawerItem> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
margin: EdgeInsets.only(top: 5, bottom: 5, left: 10, right: 10), margin: EdgeInsets.only(top: 5, bottom: 5, left: 0, right: 0),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -39,15 +39,19 @@ class _DrawerItemState extends State<DrawerItem> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( Container(
width: MediaQuery.of(context).size.width *0.45,
child: Expanded(
child: AppText(
widget.title, widget.title,
color: widget.color ?? Colors.black,
textOverflow: TextOverflow.ellipsis,
// fontWeight: FontWeight.bold,
// margin: 5,
marginLeft: 5, marginLeft: 5,
marginRight: 5, marginRight: 5,
fontSize: SizeConfig.textMultiplier * 2.3, color:widget.color ??Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier * 2.0,
fontFamily: 'Poppins',
fontWeight: FontWeight.bold,
),
),
), ),
AppText( AppText(
widget.subTitle, widget.subTitle,

Loading…
Cancel
Save