From 9d4584097d20a6567d9a284ab6d756aa7c5117b5 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 13 Apr 2021 12:34:16 +0300 Subject: [PATCH] fix flag on slider --- assets/images/saudi-arabia-flag.png | Bin 0 -> 760 bytes assets/images/usa-flag.png | Bin 0 -> 595 bytes lib/screens/profile_screen.dart | 8 +++--- lib/widgets/shared/app_drawer_widget.dart | 29 ++++++++++++++------- lib/widgets/shared/drawer_item_widget.dart | 10 ++++++- 5 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 assets/images/saudi-arabia-flag.png create mode 100644 assets/images/usa-flag.png diff --git a/assets/images/saudi-arabia-flag.png b/assets/images/saudi-arabia-flag.png new file mode 100644 index 0000000000000000000000000000000000000000..932eb11ace10469245e326640c6dc6eeab402aa0 GIT binary patch literal 760 zcmVPx#IAvH#W=%~1DgXcg2mk?xX#fNO00031000^Q000000-yo_1ONa40RR917N7$F z1ONa40RR915C8xG0I;d#zyJUOZb?KzR5%f}luJ(&Q547jcc#x7`m#-1pcSZ!jmAXO zXu?j7x-4<$j*lSUz>RA@fQiAi(csF&C8>!fE>spEXoHd#Vr$FLcRLTyy=0mWC>!)N zXYTaebAEFkcZOkcE{s-l5x^X2nDnHw1VvqNq19RiAyhR9bAHbm< q2RgjRhh@;w>ytW!v1jlr4}Sy24d@wB+4?sC0000TzkQp z+etLVQJ}P5WwMXZ{=jZIvAa57nhk!cz293|d4EG%vF-%D`yqjszSszUsp6`0Rq7HE z>tf08+xIwhKX=2$&ozRprdqvH{=W2bP-kAqDxtzT3(UeCuY|7%s(*Q1;9ai5ocUF8 z9~nQ+J0f{~WnRT4$2CD7=UvxJAO6lFJ1MD6{KxKptY+qG9?IN*ZN5XBRiv{@WmO2% z<2zq2iD$&e9A4{xV09O}{o%c=#|&eN=4A4|9PO+e2#DVdGp%2 zj(PKzef+ZIuSwFD_2D{s^WO_^H+dz@)>FVdQ&MBb@0CU0lZ~y=R literal 0 HcmV?d00001 diff --git a/lib/screens/profile_screen.dart b/lib/screens/profile_screen.dart index 283649aa..1e9e2459 100644 --- a/lib/screens/profile_screen.dart +++ b/lib/screens/profile_screen.dart @@ -57,25 +57,25 @@ class _ProfileScreenState extends State { children: [ DrawerItem( TranslationBase.of(context).gender, - Icons.person_pin, + icon: Icons.person_pin, color: Colors.black, subTitle: doctorProfile.genderDescription //"Male" , ), - DrawerItem(TranslationBase.of(context).clinic, Icons.build, + DrawerItem(TranslationBase.of(context).clinic, icon: Icons.build, color: Colors.black, subTitle: doctorProfile.clinicDescription //"Neurology Clinic", ), DrawerItem( TranslationBase.of(context).hospital, - Icons.local_hospital, + icon: Icons.local_hospital, color: Colors.black, subTitle: doctorProfile.projectName, //"Al-Takkassussi", ), DrawerItem( TranslationBase.of(context).speciality, - Icons.crop_square, + icon: Icons.crop_square, color: Colors.black, subTitle: doctorProfile.doctorRate == 0 ? TranslationBase.of(context).beingBad diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 324269c6..ee4e7aaf 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -113,7 +113,7 @@ class _AppDrawerState extends State { InkWell( child: DrawerItem( TranslationBase.of(context).applyOrRescheduleLeave, - DoctorApp.reschedule__1, + icon: DoctorApp.reschedule__1, // subTitle: , ), onTap: () { @@ -129,8 +129,10 @@ class _AppDrawerState extends State { SizedBox(height: 15), InkWell( child: DrawerItem( - TranslationBase.of(context).myQRCode, - DoctorApp.qr_code_3, + TranslationBase + .of(context) + .myQRCode, + icon: DoctorApp.qr_code_3, // subTitle: , ), ), @@ -149,7 +151,7 @@ class _AppDrawerState extends State { ), ), SizedBox( - height: 130, + height: MediaQuery.of(context).size.height * 0.09, ), Container( margin: EdgeInsets.symmetric(horizontal: 20), @@ -157,10 +159,17 @@ class _AppDrawerState extends State { children: [ InkWell( child: DrawerItem( - projectsProvider.isArabic - ? TranslationBase.of(context).lanEnglish - : TranslationBase.of(context).lanArabic, - DoctorApp.qr_code), + projectsProvider.isArabic + ? TranslationBase + .of(context) + .lanEnglish + : TranslationBase + .of(context) + .lanArabic, + // icon: DoctorApp.qr_code, + assetLink: projectsProvider.isArabic + ? 'assets/images/usa-flag.png' + : 'assets/images/saudi-arabia-flag.png',), onTap: () { if (projectsProvider.isArabic) projectsProvider.changeLanguage('en'); @@ -171,7 +180,9 @@ class _AppDrawerState extends State { SizedBox(height: 10), InkWell( child: DrawerItem( - TranslationBase.of(context).logout, DoctorApp.logout_1), + TranslationBase + .of(context) + .logout, icon: DoctorApp.logout_1,), onTap: () async { Navigator.pop(context); await helpers.logout(); diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 1a34a8ca..3dcac4c9 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -15,8 +15,9 @@ class DrawerItem extends StatefulWidget { final String subTitle; final IconData icon; final Color color; + final String assetLink; - DrawerItem(this.title, this.icon, {this.color, this.subTitle = ''}); + DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink}); @override _DrawerItemState createState() => _DrawerItemState(); @@ -30,6 +31,13 @@ class _DrawerItemState extends State { child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ + if(widget.assetLink!=null) + Container( + height: 20, + width: 20, + child: Image.asset(widget.assetLink), + ), + if(widget.assetLink==null) Icon( widget.icon, color: widget.color ?? Colors.black87,