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,127 +39,112 @@ 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: Column(
child: DrawerHeader( crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.center, Container(
children: <Widget>[ child: Image.asset(
Container( 'assets/images/dr_app_logo.png',
child: Image.asset( ),
'assets/images/logo.png', margin: EdgeInsets.only(top: 10, bottom: 15),
), ),
margin: EdgeInsets.only(top: 10, bottom: 15), SizedBox(height: 15),
), if (authProvider.doctorProfile != null)
SizedBox( InkWell(
height: 1, onTap: () {
child: Container( Navigator.of(context).pushNamed(PROFILE, arguments: {
color: Colors.black26, 'title': authProvider.doctorProfile.doctorName,
), "doctorProfileall": authProvider.doctorProfile
), });
SizedBox(height: 15), },
InkWell( child: Column(
onTap: () { crossAxisAlignment: CrossAxisAlignment.start,
Navigator.of(context) children: [
.pushNamed(PROFILE, arguments: { Padding(
'title': authProvider.doctorProfile.doctorName, padding: EdgeInsets.only(top: 10),
"doctorProfileall": authProvider.doctorProfile child: AppText(
}); TranslationBase.of(context).dr +
}, authProvider.doctorProfile?.doctorName,
child: Column( fontWeight: FontWeight.bold,
children: [ color: Color(0xFF2E303A),
authProvider.doctorProfile != null fontFamily: 'Poppins',
? CircleAvatar( fontSize: SizeConfig.textMultiplier * 2.5,
radius: ),
SizeConfig.imageSizeMultiplier * 12, ),
// radius: (52) Padding(
child: ClipRRect( padding: EdgeInsets.only(top: 5),
borderRadius: BorderRadius.circular(50), child: AppText(
child: Image.network( authProvider.doctorProfile?.clinicDescription,
authProvider fontWeight: FontWeight.w600,
.doctorProfile.doctorImageURL, color: Color(0xFF2E303A),
fit: BoxFit.fill, fontSize: SizeConfig.textMultiplier * 2,
width: 700, fontFamily: 'Poppins',
), ))
), ],
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;
},
), ),
], ),
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( SizedBox(
child: DrawerItem( height: 40,
TranslationBase.of(context).settings, Icons.settings),
onTap: () {
Navigator.pop(context);
Navigator.of(context).pushNamed(SETTINGS);
},
), ),
InkWell( Container(
child: DrawerItem( margin: EdgeInsets.symmetric(horizontal: 20),
TranslationBase.of(context).reschedule, child: Column(
DoctorApp.leaves, children: [
subTitle: TranslationBase.of(context).leaves, 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( child: Align(
alignment: FractionalOffset.bottomCenter, alignment: FractionalOffset.bottomCenter,
child: Container( child: Container(
child: Column( child: Row(
children: <Widget>[ mainAxisAlignment: MainAxisAlignment.center,
Text("Powered by"), children: <Widget>[
Image.asset( Container(
'assets/images/cs_logo_container.png', width: MediaQuery.of(context).size.width *0.3,
width: SizeConfig.imageSizeMultiplier * 30, 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,
)
],
)))) ))))
])) ]))
])), ])),

@ -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(
widget.title, width: MediaQuery.of(context).size.width *0.45,
color: widget.color ?? Colors.black, child: Expanded(
textOverflow: TextOverflow.ellipsis, child: AppText(
// fontWeight: FontWeight.bold, widget.title,
// margin: 5, marginLeft: 5,
marginLeft: 5, marginRight: 5,
marginRight: 5, color:widget.color ??Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier * 2.3, fontSize: SizeConfig.textMultiplier * 2.0,
fontFamily: 'Poppins',
fontWeight: FontWeight.bold,
),
),
), ),
AppText( AppText(
widget.subTitle, widget.subTitle,

Loading…
Cancel
Save