From eb5e5862ec2d574e0f050dd286b20f72d7591804 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 12 Apr 2021 14:01:20 +0300 Subject: [PATCH] fix bugs --- lib/config/localized_values.dart | 7 +++ .../profile/patient_profile_screen.dart | 2 +- lib/util/translations_delegate_base.dart | 5 ++ lib/widgets/doctor/my_schedule_widget.dart | 3 - lib/widgets/shared/app_drawer_widget.dart | 60 +++++++++++-------- lib/widgets/shared/bottom_nav_bar.dart | 12 ++-- .../shared/bottom_navigation_item.dart | 15 +---- lib/widgets/shared/drawer_item_widget.dart | 11 +--- ..._key_checkbox_search_allergies_widget.dart | 31 +++++++--- 9 files changed, 82 insertions(+), 64 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 194ee2af..426bd882 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -843,4 +843,11 @@ const Map> localizedValues = { "en": "Step", "ar": "خطوة" }, + "applyOrRescheduleLeave": { + "en": "Apply Or Reschedule Leave", + "ar": "التقدم بطلب أو إعادة جدولة الإجازة" + },"myQRCode": { + "en": "My QR Code", + "ar": "My QR Code" + }, }; diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index bce7fa01..63a1247b 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -162,7 +162,7 @@ class PatientProfileScreen extends StatelessWidget { Navigator.of(context).pushNamed( UPDATE_EPISODE, arguments: {'patient': patient}); - }; + } } ), ], diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 6094331f..265c7280 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -622,6 +622,11 @@ class TranslationBase { String get rescheduleLeaves => localizedValues['reschedule-leave'][locale.languageCode]; + String get applyOrRescheduleLeave => + localizedValues['applyOrRescheduleLeave'][locale.languageCode]; + String get myQRCode => + localizedValues['myQRCode'][locale.languageCode]; + String get addMedication => localizedValues['addMedication'][locale.languageCode]; diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index d705010d..40b24cba 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -35,9 +35,6 @@ class MyScheduleWidget extends StatelessWidget { fontFamily: 'Poppins', // fontSize: 18 ), - SizedBox( - height: 10, - ), AppText( ' ${workingHoursTable.date.day} ${(DateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', fontSize: 18, diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 6193204d..324269c6 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -45,18 +45,36 @@ class _AppDrawerState extends State { flex: 4, child: ListView(padding: EdgeInsets.zero, children: [ Container( - margin: EdgeInsets.symmetric(horizontal: 20), + margin: EdgeInsets.symmetric(horizontal: 15), // height: SizeConfig.heightMultiplier * 50, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - child: Image.asset( - 'assets/images/dr_app_logo.png', - ), - margin: EdgeInsets.only(top: 10, bottom: 10), + Row( + children: [ + Container( + child: Image.asset( + 'assets/images/dr_app_logo.png', + ), + margin: EdgeInsets.only(top: 10, bottom: 10), + ), + Container( + child: InkWell( + onTap: (){ + Navigator.pop(context); + }, + child: Icon( + DoctorApp.close_1, + size: 20, + ), + ), + margin: EdgeInsets.only(top: 20, bottom: 10), + ) + ], + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, ), - SizedBox(height: 10), + SizedBox(height: 5), if (authProvider.doctorProfile != null) InkWell( onTap: () { @@ -80,7 +98,7 @@ class _AppDrawerState extends State { ), ), Padding( - padding: EdgeInsets.only(top: 5), + padding: EdgeInsets.only(top: 0), child: AppText( authProvider.doctorProfile?.clinicDescription, fontWeight: FontWeight.w600, @@ -91,13 +109,10 @@ class _AppDrawerState extends State { ], ), ), - SizedBox(height: 10), + SizedBox(height: 40), InkWell( child: DrawerItem( - TranslationBase.of(context).rescheduleLeaves, - // " or " + - // TranslationBase.of(context).leaves, - + TranslationBase.of(context).applyOrRescheduleLeave, DoctorApp.reschedule__1, // subTitle: , ), @@ -111,19 +126,15 @@ class _AppDrawerState extends State { )); }, ), - - SizedBox(height: 10), + SizedBox(height: 15), InkWell( child: DrawerItem( - 'My QR Code', - // " or " + - // TranslationBase.of(context).leaves, - + TranslationBase.of(context).myQRCode, DoctorApp.qr_code_3, // subTitle: , ), ), - + SizedBox(height: 15), InkWell( child: Container( height: 80, @@ -138,14 +149,12 @@ class _AppDrawerState extends State { ), ), SizedBox( - height: 40, + height: 130, ), Container( margin: EdgeInsets.symmetric(horizontal: 20), child: Column( children: [ - - InkWell( child: DrawerItem( projectsProvider.isArabic @@ -159,6 +168,7 @@ class _AppDrawerState extends State { projectsProvider.changeLanguage('ar'); }, ), + SizedBox(height: 10), InkWell( child: DrawerItem( TranslationBase.of(context).logout, DoctorApp.logout_1), @@ -193,13 +203,13 @@ class _AppDrawerState extends State { style: TextStyle( color: Color(0xFF989898), fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2, + fontSize: 14, fontFamily: 'Poppins',), children: [ TextSpan(text: ' Cloud Solutions', style: TextStyle( color: Color(0xFF2E303A), - fontSize: SizeConfig.textMultiplier * 2, + fontSize: 15, fontFamily: 'Poppins',), ) ] diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index 0f5673ab..d3b07254 100644 --- a/lib/widgets/shared/bottom_nav_bar.dart +++ b/lib/widgets/shared/bottom_nav_bar.dart @@ -37,23 +37,23 @@ class _BottomNavBarState extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ BottomNavigationItem( - icon: DoctorApp.home_icon_active, - activeIcon: DoctorApp.home_active, + icon: DoctorApp.home_1, + activeIcon: DoctorApp.home_active_1, changeIndex: _changeIndex, index: _index, currentIndex: 0, name: TranslationBase.of(context).home, ), BottomNavigationItem( - icon: DoctorApp.schedule_icon, - activeIcon: DoctorApp.scdedule_icon_active_1, + icon: DoctorApp.schedule_1, + activeIcon: DoctorApp.schedule_active_1, changeIndex: _changeIndex, index: _index, currentIndex: 1, name: TranslationBase.of(context).mySchedule, ), BottomNavigationItem( - icon: DoctorApp.qr_code, + icon: DoctorApp.qr_reader, activeIcon: DoctorApp.qr_reader_active_1, changeIndex: _changeIndex, index: _index, @@ -61,7 +61,7 @@ class _BottomNavBarState extends State { name: TranslationBase.of(context).qr, ), BottomNavigationItem( - icon: DoctorApp.message_icon, + icon: DoctorApp.dr_reply_1, activeIcon: DoctorApp.dr_reply_active_1, changeIndex: _changeIndex, index: _index, diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index 501a354d..e69ff690 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -34,19 +34,10 @@ class BottomNavigationItem extends StatelessWidget { children: [ SizedBox(height: 15,), Container( -// decoration: BoxDecoration(boxShadow: [ -// BoxShadow( -// color: currentIndex == index -// ? Color.fromRGBO(78, 62, 253, 0.4) -// : Color.fromRGBO(78, 62, 253, 0), -// blurRadius: 9.0, -// spreadRadius: -4.0, -// offset: Offset(0.0, 2.0)) -// ]), child: Icon(currentIndex == index ? activeIcon : icon, - /*color: currentIndex == index - ? Theme.of(context).primaryColor - : Theme.of(context).dividerColor,*/ + color: currentIndex == index + ? Color(0xFF333C45) + : Theme.of(context).dividerColor, size: 22.0), ), SizedBox(height: 5,), diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 248123a6..1a34a8ca 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -26,7 +26,7 @@ class _DrawerItemState extends State { @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.only(top: 5, bottom: 5, left: 0, right: 0), + margin: EdgeInsets.only(top: 0, bottom: 5, left: 0, right: 0), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -49,16 +49,9 @@ class _DrawerItemState extends State { color:widget.color ??Color(0xFF2E303A), fontSize: 14, fontFamily: 'Poppins', - fontWeight: FontWeight.bold, + fontWeight: FontWeight.w600, ), ), - AppText( - widget.subTitle, - visibility: !widget.subTitle.isNullOrEmpty(), - color: widget.color ?? Colors.black, - marginLeft: 5, - fontSize: SizeConfig.textMultiplier * 2.5, - ), ], ), ), diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart index f84db092..f85d2fe6 100644 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -137,14 +137,29 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState items[index]), activeColor: Colors.red[800], onChanged: (bool newValue) { - // setState(() { - // if (widget - // .isServiceSelected(items[index])) { - // widget.removeHistory(items[index]); - // } else { - // widget.addHistory(items[index]); - // } - // }); + setState(() { + if (widget + .isServiceSelected( + items[index])) { + widget.removeAllergy( + items[index]); + } else { + // TODO add Allergy + + MySelectedAllergy + mySelectedAllergy = + new MySelectedAllergy( + selectedAllergy: + items[index], + selectedAllergySeverity: + _selectedAllergySeverity, + remark: null, + isChecked: true, + isExpanded: true); + widget.addAllergy( + mySelectedAllergy); + } + }); }), InkWell( onTap: () {