diff --git a/assets/images/new/E_Referral.svg b/assets/images/new/E_Referral.svg new file mode 100644 index 00000000..fb6b8591 --- /dev/null +++ b/assets/images/new/E_Referral.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/images/new/HHC.svg b/assets/images/new/HHC.svg index 5c0aacd1..692623c2 100644 --- a/assets/images/new/HHC.svg +++ b/assets/images/new/HHC.svg @@ -1,8 +1,9 @@ - - - - - + + + + + + diff --git a/assets/images/new/Live_Care.svg b/assets/images/new/Live_Care.svg index 84349a70..b5a367d7 100644 --- a/assets/images/new/Live_Care.svg +++ b/assets/images/new/Live_Care.svg @@ -1,8 +1,11 @@ - - - - - + + + + + + + + + - diff --git a/assets/images/new/comprehensive_checkup.svg b/assets/images/new/comprehensive_checkup.svg index a22c960c..b3f2feb1 100644 --- a/assets/images/new/comprehensive_checkup.svg +++ b/assets/images/new/comprehensive_checkup.svg @@ -1,7 +1,6 @@ - - - - - + + + + diff --git a/assets/images/new/covid_test_drive_thru.svg b/assets/images/new/covid_test_drive_thru.svg index 09de0045..563de151 100644 --- a/assets/images/new/covid_test_drive_thru.svg +++ b/assets/images/new/covid_test_drive_thru.svg @@ -1,10 +1,20 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/emergency.svg b/assets/images/new/emergency.svg new file mode 100644 index 00000000..a1a0178a --- /dev/null +++ b/assets/images/new/emergency.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/h2o.svg b/assets/images/new/h2o.svg new file mode 100644 index 00000000..cab6a705 --- /dev/null +++ b/assets/images/new/h2o.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/new/menu.svg b/assets/images/new/menu.svg new file mode 100644 index 00000000..05654cdb --- /dev/null +++ b/assets/images/new/menu.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/new/payment.png b/assets/images/new/payment.png new file mode 100644 index 00000000..0bdb006b Binary files /dev/null and b/assets/images/new/payment.png differ diff --git a/assets/images/new/reach_us.svg b/assets/images/new/reach_us.svg new file mode 100644 index 00000000..b4634170 --- /dev/null +++ b/assets/images/new/reach_us.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/new/visa.png b/assets/images/new/visa.png new file mode 100644 index 00000000..a2836f13 Binary files /dev/null and b/assets/images/new/visa.png differ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 616e7c44..fa910242 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -435,11 +435,13 @@ const Map localizedValues = { "StartDay": {"en": "Start Day", "ar": "يوم البداية"}, "EndDay": {"en": "End Day", "ar": "يوم الانتهاء"}, "Days": {"en": "Days ", "ar": "أيام"}, + "please-verify": {"en": "Please Verify ", "ar": "ارجوك تحقق"}, "ScheduleTime": {"en": "Schedule time", "ar": "الجدول الزمني"}, "AskDoctor": {"en": "Ask Doctor", "ar": "اسأل طبيبك"}, "DoctorResponses": {"en": "Doctor Responses", "ar": "ردود الأطباء"}, "New": {"en": "New", "ar": "جديد"}, "All": {"en": "All", "ar": "الكل"}, + "dailyWater": {"en": "Daily Water Check", "ar": "فحص المياه اليومي"}, "QuestionHere": {"en": "Enter the question here...", "ar": "اضف الاستفسار هنا"}, "ViewDoctorResponses": {"en": "View Doctor Responses", "ar": "الاطلاع على ردود الأطباء"}, "ServiceInformationButton": {"en": "LOGIN / REGISTER", "ar": "دخول / تسجيل"}, diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 6d6d28c5..4416062b 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -47,10 +47,13 @@ class _HomePageFragment2State extends State { hmgServices.clear(); hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); hmgServices.add(new HmgServices(1, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/covid_test_drive_thru.svg", isLogin)); - hmgServices.add(new HmgServices(2, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); + hmgServices.add(new HmgServices(2, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/visa.png", isLogin)); hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); - hmgServices.add(new HmgServices(4, TranslationBase.of(context).refferal, TranslationBase.of(context).services2, "assets/images/new/E_Refferal.svg", isLogin)); - hmgServices.add(new HmgServices(5, "RRT", TranslationBase.of(context).emergency, "assets/images/new/RRT.svg", isLogin)); + hmgServices.add(new HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); + hmgServices.add(new HmgServices(5, "RRT", TranslationBase.of(context).emergency, "assets/images/new/emergency.svg", isLogin)); + hmgServices.add(new HmgServices(6, TranslationBase.of(context).refferal, TranslationBase.of(context).services2, "assets/images/new/E_Referral.svg", isLogin)); + hmgServices.add(new HmgServices(7, "H\u2082O", TranslationBase.of(context).dailyWater, "assets/images/new/h2o.svg", isLogin)); + hmgServices.add(new HmgServices(8, TranslationBase.of(context).reachUs, TranslationBase.of(context).findUs, "assets/images/new/reach_us.svg", isLogin)); } @override @@ -65,9 +68,9 @@ class _HomePageFragment2State extends State { children: [ projectViewModel.isLogin ? AspectRatio( - aspectRatio: 2.5, + aspectRatio: 2.7, child: Padding( - padding: const EdgeInsets.only(left: 20, right: 20, top: 16, bottom: 6), + padding: const EdgeInsets.only(left: 20, right: 20, top: 8, bottom: 6), child: LoggedSliderView( projectViewModel, new SliderData(TranslationBase.of(context).fileno + ": " + projectViewModel.user.patientID.toString(), projectViewModel.user.firstName + ' ' + projectViewModel.user.lastName, @@ -75,9 +78,9 @@ class _HomePageFragment2State extends State { ), ) : AspectRatio( - aspectRatio: 2.5, + aspectRatio: 2.7, child: Container( - margin: EdgeInsets.only(left: 20, right: 20, top: 16, bottom: 6), + margin: EdgeInsets.only(left: 20, right: 20, top: 8, bottom: 6), child: SliderView( onLoginClick: () { widget.onLoginClick(); @@ -279,6 +282,29 @@ class _HomePageFragment2State extends State { ], ), ), + projectViewModel.isArabic + ? Positioned( + left: 20, + top: 12, + child: Opacity( + opacity: 0.04, + child: SvgPicture.asset( + "assets/images/new/logo.svg", + height: MediaQuery.of(context).size.width * 0.14, + ), + ), + ) + : Positioned( + right: 20, + top: 12, + child: Opacity( + opacity: 0.04, + child: SvgPicture.asset( + "assets/images/new/logo.svg", + height: MediaQuery.of(context).size.width * 0.14, + ), + ), + ), projectViewModel.isArabic ? Positioned( right: -16, @@ -404,7 +430,7 @@ class _HomePageFragment2State extends State { left: 20, top: 12, child: Opacity( - opacity: 0.1, + opacity: 0.04, child: SvgPicture.asset( "assets/images/new/Pharmacy.svg", height: MediaQuery.of(context).size.width * 0.15, @@ -415,7 +441,7 @@ class _HomePageFragment2State extends State { right: 20, top: 12, child: Opacity( - opacity: 0.1, + opacity: 0.04, child: SvgPicture.asset( "assets/images/new/Pharmacy.svg", height: MediaQuery.of(context).size.width * 0.15, diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index e98636da..c4a7391e 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -20,6 +20,7 @@ import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' as family; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; import 'package:diplomaticquarterapp/uitl/HMGNetworkConnectivity.dart'; import 'package:diplomaticquarterapp/uitl/HMG_Geofence.dart'; @@ -40,6 +41,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; @@ -498,85 +500,90 @@ class _LandingPageState extends State with WidgetsBindingObserver { projectViewModel = Provider.of(context); return Scaffold( - appBar: AppBar( - elevation: 0, - textTheme: TextTheme( - headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold), - ), - title: Text( - getText(currentTab).toUpperCase(), - style: TextStyle(fontWeight: FontWeight.bold, color: Theme.of(context).textTheme.headline1.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), - // bold: true, - // color: Colors.white, - ), - leading: Builder( - builder: (BuildContext context) { - return new Stack( - children: [ - currentTab == 0 - ? IconButton( - icon: Icon(Icons.menu), - color: Theme.of(context).textTheme.headline1.color, - onPressed: () => Scaffold.of(context).openDrawer(), - ) - : IconButton( - icon: Icon(Icons.arrow_back), - color: Theme.of(context).textTheme.headline1.color, - onPressed: () { - setState(() { - currentTab = 0; - }); - - pageController.jumpToPage(0); - }, - ), - notificationCount != '' - ? new Positioned( - right: projectViewModel.isArabic ? 35 : 0, - top: 5, - child: new Container( - padding: EdgeInsets.all(4), - decoration: new BoxDecoration( - color: Colors.red, - borderRadius: BorderRadius.circular(20), - ), - constraints: BoxConstraints( - minWidth: 20, - minHeight: 20, - ), - child: new Text( - notificationCount, - style: new TextStyle( - color: Colors.white, - fontSize: projectViewModel.isArabic ? 8 : 9, + appBar: PreferredSize( + preferredSize: Size.fromHeight(currentTab == 0 ? 45 : 0.0), + child: AppBar( + elevation: 0, + backgroundColor: CustomColors.backgroudGreyColor , + textTheme: TextTheme( + headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold), + ), + title: Text( + getText(currentTab).toUpperCase(), + style: TextStyle( + fontWeight: FontWeight.bold, + color: currentTab == 0 ? CustomColors.backgroudGreyColor : Theme.of(context).textTheme.headline1.color, + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), + // bold: true, + ), + leading: Builder( + builder: (BuildContext context) { + return new Stack( + children: [ + currentTab == 0 + ? IconButton( + icon: SvgPicture.asset("assets/images/new/menu.svg"), + color: Theme.of(context).textTheme.headline1.color, + onPressed: () => Scaffold.of(context).openDrawer(), + ) + : IconButton( + icon: Icon(Icons.arrow_back), + onPressed: () { + setState(() { + currentTab = 0; + }); + + pageController.jumpToPage(0); + }, + ), + notificationCount != '' + ? new Positioned( + right: projectViewModel.isArabic ? 35 : 0, + top: 5, + child: new Container( + padding: EdgeInsets.all(4), + decoration: new BoxDecoration( + color: Colors.red, + borderRadius: BorderRadius.circular(20), + ), + constraints: BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: new Text( + notificationCount, + style: new TextStyle( + color: Colors.white, + fontSize: projectViewModel.isArabic ? 8 : 9, + ), + textAlign: TextAlign.center, ), - textAlign: TextAlign.center, ), - ), - ) - : SizedBox() - ], - ); - }, + ) + : SizedBox() + ], + ); + }, + ), + actions: [ + // IconButton( + // //iconSize: 70, + // icon: Icon( + // projectViewModel.isLogin ? Icons.settings : Icons.login, + // color: Theme.of(context).textTheme.headline1.color, + // ), + // onPressed: () { + // if (projectViewModel.isLogin) + // Navigator.of(context).pushNamed( + // SETTINGS, + // ); + // else + // login(); + // }, //do something, + // ) + ], + centerTitle: true, ), - actions: [ - IconButton( - //iconSize: 70, - icon: Icon( - projectViewModel.isLogin ? Icons.settings : Icons.login, - color: Theme.of(context).textTheme.headline1.color, - ), - onPressed: () { - if (projectViewModel.isLogin) - Navigator.of(context).pushNamed( - SETTINGS, - ); - else - login(); - }, //do something, - ) - ], - centerTitle: true, ), drawer: SafeArea(child: AppDrawer()), extendBody: true, diff --git a/lib/pages/landing/widgets/services_view.dart b/lib/pages/landing/widgets/services_view.dart index 6180ae3a..6ebf8a05 100644 --- a/lib/pages/landing/widgets/services_view.dart +++ b/lib/pages/landing/widgets/services_view.dart @@ -4,9 +4,12 @@ import 'package:diplomaticquarterapp/models/hmg_services.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h2o_page.dart'; +import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; +import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -28,13 +31,19 @@ class ServicesView extends StatelessWidget { } else if (index == 1) { Navigator.push(context, FadePage(page: CovidDrivethruLocation())); } else if (index == 2) { - Navigator.push(context, FadePage(page: CMCPage())); + Navigator.push(context, FadePage(page: PaymentService())); } else if (index == 3) { Navigator.push(context, FadePage(page: HomeHealthCarePage())); } else if (index == 4) { - Navigator.push(context, FadePage(page: EReferralPage())); + Navigator.push(context, FadePage(page: CMCPage())); } else if (index == 5) { Navigator.push(context, FadePage(page: ErOptions(isAppbar: true))); + } else if (index == 6) { + Navigator.push(context, FadePage(page: EReferralPage())); + } else if (index == 7) { + Navigator.push(context, FadePage(page: H2OPage())); + } else if (index == 8) { + Navigator.push(context, FadePage(page: FindUsPage())); } }, child: Container( @@ -60,12 +69,18 @@ class ServicesView extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(12.0), child: Opacity( - opacity: 0.07, - child: SvgPicture.asset( - hmgServices.icon, - width: double.infinity, - height: double.infinity, - ), + opacity: 0.04, + child: hmgServices.action == 2 + ? Image.asset( + hmgServices.icon, + width: double.infinity, + height: double.infinity, + ) + : SvgPicture.asset( + hmgServices.icon, + width: double.infinity, + height: double.infinity, + ), ), ), ), @@ -84,10 +99,15 @@ class ServicesView extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ mFlex(1), - SvgPicture.asset( - hmgServices.icon, - height: index == 0 ? MediaQuery.of(context).size.width / 18 : MediaQuery.of(context).size.width / 14, - ), + hmgServices.action == 2 + ? Image.asset( + hmgServices.icon, + height: index == 0 ? MediaQuery.of(context).size.width / 18 : MediaQuery.of(context).size.width / 14, + ) + : SvgPicture.asset( + hmgServices.icon, + height: index == 0 ? MediaQuery.of(context).size.width / 18 : MediaQuery.of(context).size.width / 14, + ), mFlex(4), AutoSizeText( hmgServices.title, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index d25ce6cc..0ea4b4dd 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -192,7 +192,7 @@ class TranslationBase { String get pendingPayment => localizedValues['pendingPayment'][locale.languageCode]; String get payNow => localizedValues['payNow'][locale.languageCode]; - + String get dailyWater => localizedValues['dailyWater'][locale.languageCode]; String get viewQR => localizedValues['viewQR'][locale.languageCode]; String get instruction => localizedValues['instruction'][locale.languageCode]; diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 63031263..a00d19ea 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -61,6 +61,10 @@ class _AppDrawerState extends State { @override Widget build(BuildContext context) { projectProvider = Provider.of(context); + // (user.isFamily == null || user.isFamily == false) && projectProvider.havePrivilege(2) + print(user.isFamily.toString()); + print(user.isFamily.toString()); + print(projectProvider.havePrivilege(2).toString()); return Container( width: MediaQuery.of(context).size.width * 0.75, color: Theme.of(context).scaffoldBackgroundColor, @@ -78,7 +82,8 @@ class _AppDrawerState extends State { Container( height: SizeConfig.screenHeight * .30, child: InkWell( - child: DrawerHeader( + child: Padding( + padding: const EdgeInsets.all(14.0), child: Column( children: [ Container( @@ -97,64 +102,31 @@ class _AppDrawerState extends State { ], ), ), - (user != null && projectProvider.isLogin) - ? Padding( - padding: EdgeInsets.all(15), - child: Column(mainAxisAlignment: MainAxisAlignment.start, children: [ - Row( - children: [ - Padding( - padding: EdgeInsets.only(right: 5), - child: Icon( - Icons.account_circle, - color: Color(0xFF40ACC9), - )), - AppText( - user.firstName + ' ' + user.lastName, - color: Color(0xFF40ACC9), - ) - ], - ), - Row(children: [ - Padding( - padding: EdgeInsets.only(left: 30, top: 5), - child: Column( - children: [ - AppText( - TranslationBase.of(context).fileno + ": " + user.patientID.toString(), - color: Color(0xFF40ACC9), - fontSize: SizeConfig.textMultiplier * 1.5, - ), - AppText( - user.bloodGroup != null ? 'Blood Group: ' + user.bloodGroup : '', - fontSize: SizeConfig.textMultiplier * 1.5, - ), - ], - )) - ]) - ])) - : Container( - width: double.infinity, - margin: EdgeInsets.only(top: 12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).cantSeeProfile, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 18, - ), - ), - Text( - TranslationBase.of(context).loginRegisterNow, - style: TextStyle(color: Colors.black, fontSize: 14), - ), - ], + mHeight(12), + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + (user != null && projectProvider.isLogin) ? user.firstName + ' ' + user.lastName : TranslationBase.of(context).cantSeeProfile, + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 18, ), ), + Text( + (user != null && projectProvider.isLogin) + ? TranslationBase.of(context).fileno + ": " + user.patientID.toString() + : TranslationBase.of(context).loginRegisterNow, + style: TextStyle(color: Colors.black, fontSize: 14), + ), + ], + ), + ), ], ), ), @@ -164,34 +136,37 @@ class _AppDrawerState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - InkWell( - child: DrawerItem( - TranslationBase.of(context).arabicChange, - Padding(child: Image.asset('assets/images/lang.png'), padding: EdgeInsets.all(3)), - isImageIcon: true, - bottomLine: false, - ), - onTap: () { - sharedPref.setBool(IS_ROBOT_INIT, null); - if (projectProvider.isArabic) { - projectProvider.changeLanguage('en'); - } else { - projectProvider.changeLanguage('ar'); - } - }, - ), + (user != null && projectProvider.isLogin) + ? Container() + : InkWell( + child: DrawerItem( + TranslationBase.of(context).arabicChange, + Padding(child: Image.asset('assets/images/lang.png'), padding: EdgeInsets.all(3)), + isImageIcon: true, + bottomLine: false, + ), + onTap: () { + sharedPref.setBool(IS_ROBOT_INIT, null); + if (projectProvider.isArabic) { + projectProvider.changeLanguage('en'); + } else { + projectProvider.changeLanguage('ar'); + } + }, + ), (user != null && projectProvider.isLogin) ? Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - (user.isFamily == null || user.isFamily == false) && projectProvider.havePrivilege(2) + (user.isFamily == null || user.isFamily == false) ? InkWell( child: DrawerItem( TranslationBase.of(context).family, - Icons.group, + SvgPicture.asset("assets/images/new/family_files.svg"), + isImageIcon: true, + bottomLine: false, textColor: Theme.of(context).textTheme.bodyText1.color, iconColor: Theme.of(context).textTheme.bodyText1.color, - bottomLine: false, sideArrow: true, ), onTap: () { @@ -213,73 +188,99 @@ class _AppDrawerState extends State { return Padding(padding: EdgeInsets.all(10), child: Text(snapshot.error)); else return Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - // <--- left side - color: Colors.grey[200], - width: 1.0, - ), - )), child: Column( - children: [ - user.isFamily == true - ? Container( - padding: EdgeInsets.only(bottom: 5), - child: InkWell( + children: [ + user.isFamily == true + ? Container( + padding: EdgeInsets.only(bottom: 5, left: 4), + child: InkWell( + onTap: () { + switchUser(mainUser, context); + }, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: SvgPicture.asset("assets/images/new/family_files.svg"), + ), + Expanded( + flex: 7, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(mainUser.firstName + ' ' + mainUser.lastName, color: Theme.of(context).textTheme.bodyText1.color), + AppText( + TranslationBase.of(context).fileno + ": " + mainUser.patientID.toString(), + color: Theme.of(context).textTheme.bodyText1.color, + ), + ], + ), + ), + ], + ), + ), + ) + : SizedBox(), + Column( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: snapshot.data.getAllSharedRecordsByStatusList.map((result) { + return result.status == 3 + ? Container( + padding: EdgeInsets.only(bottom: 5), + child: InkWell( onTap: () { - switchUser(mainUser, context); + switchUser(result, context); }, child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( - child: Icon(Icons.person), + child: Icon(Icons.person, color: result.responseID == user.patientID ? Colors.transparent : Colors.transparent), ), Expanded( - flex: 7, - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText(mainUser.firstName + ' ' + mainUser.lastName, color: Theme.of(context).textTheme.bodyText1.color), - AppText( - TranslationBase.of(context).fileno + ": " + mainUser.patientID.toString(), - color: Theme.of(context).textTheme.bodyText1.color, - ), - ])), + flex: 7, + child: Padding( + padding: EdgeInsets.only(left: 5, right: 5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(result.patientName, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), + AppText(TranslationBase.of(context).fileno + ": " + result.responseID.toString(), + color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), + Divider( + color: Colors.grey[400], + ), + ], + ), + ), + ), ], - ))) - : SizedBox(), - Column( - mainAxisAlignment: MainAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: snapshot.data.getAllSharedRecordsByStatusList.map((result) { - return result.status == 3 - ? Container( - padding: EdgeInsets.only(bottom: 5), - child: InkWell( - onTap: () { - switchUser(result, context); - }, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Icon(Icons.person, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), - ), - Expanded( - flex: 7, - child: Padding( - padding: EdgeInsets.only(left: 5, right: 5), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText(result.patientName, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), - AppText(TranslationBase.of(context).fileno + ": " + result.responseID.toString(), - color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), - ]))), - ], - ))) - : SizedBox(); - }).toList()) - ], - )); + ), + ), + ) + : SizedBox(); + }).toList()) + ], + )); + } + }, + ), + mHeight(20), + InkWell( + child: DrawerItem( + TranslationBase.of(context).arabicChange, + Padding(child: Image.asset('assets/images/lang.png'), padding: EdgeInsets.only(left: 3, right: 3, top: 3, bottom: projectProvider.isArabic ? 3 : 0)), + isImageIcon: true, + bottomLine: false, + fontHeight: projectProvider.isArabic ? 1 : 0.8, + ), + onTap: () { + sharedPref.setBool(IS_ROBOT_INIT, null); + if (projectProvider.isArabic) { + projectProvider.changeLanguage('en'); + } else { + projectProvider.changeLanguage('ar'); } }, ), @@ -288,7 +289,9 @@ class _AppDrawerState extends State { children: [ DrawerItem( TranslationBase.of(context).notification, - Icons.notifications, + SvgPicture.asset("assets/images/new/notifications.svg"), + isImageIcon: true, + bottomLine: false, count: notificationCount != null ? new Container( padding: EdgeInsets.all(4), @@ -323,7 +326,12 @@ class _AppDrawerState extends State { ), if (projectProvider.havePrivilege(3)) InkWell( - child: DrawerItem(TranslationBase.of(context).appsetting, Icons.settings_input_composite), + child: DrawerItem( + TranslationBase.of(context).appsetting, + SvgPicture.asset("assets/images/new/app_setting.svg"), + isImageIcon: true, + bottomLine: false, + ), onTap: () { Navigator.of(context).pushNamed( SETTINGS, @@ -331,7 +339,11 @@ class _AppDrawerState extends State { }, ), InkWell( - child: DrawerItem(TranslationBase.of(context).rateApp, Icons.star), + child: DrawerItem( + TranslationBase.of(context).rateApp, + Icons.star, + bottomLine: false, + ), onTap: () { if (Platform.isIOS) { launch("https://apps.apple.com/sa/app/dr-suliaman-alhabib/id733503978"); @@ -345,6 +357,7 @@ class _AppDrawerState extends State { TranslationBase.of(context).logout, SvgPicture.asset("assets/images/new/logout.svg"), isImageIcon: true, + bottomLine: false, ), onTap: () { logout(); @@ -468,6 +481,7 @@ class _AppDrawerState extends State { GifLoaderDialogUtils.showMyDialog(context); this.familyFileProvider.silentLoggin(user is AuthenticatedUser ? null : user, mainUser: user is AuthenticatedUser).then((value) { GifLoaderDialogUtils.hideDialog(context); + Navigator.of(context).pop(); loginAfter(value, context); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/widgets/drawer/drawer_item_widget.dart b/lib/widgets/drawer/drawer_item_widget.dart index beb6ef4a..2f0508f0 100644 --- a/lib/widgets/drawer/drawer_item_widget.dart +++ b/lib/widgets/drawer/drawer_item_widget.dart @@ -16,14 +16,9 @@ class DrawerItem extends StatefulWidget { final bool sideArrow; final Widget count; final bool isImageIcon; - DrawerItem(this.title, this.icon, - {this.textColor, - this.iconColor, - this.subTitle = '', - this.bottomLine = true, - this.count, - this.sideArrow = false, - this.isImageIcon = false}); + final double fontHeight; + + DrawerItem(this.title, this.icon, {this.textColor, this.iconColor, this.subTitle = '', this.bottomLine = true, this.count, this.sideArrow = false, this.isImageIcon = false,this.fontHeight}); @override _DrawerItemState createState() => _DrawerItemState(); @@ -53,39 +48,31 @@ class _DrawerItemState extends State { ? widget.icon : Icon( widget.icon, - color: widget.iconColor == null - ? Theme.of(context).textTheme.bodyText1.color - : widget.iconColor, + color: widget.iconColor == null ? Theme.of(context).textTheme.bodyText1.color : widget.iconColor, size: SizeConfig.imageSizeMultiplier * 5, )), Expanded( flex: 7, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - children: [ - AppText( - widget.title, - fontSize: SizeConfig.textMultiplier * 2.3, - ), - widget.count ?? SizedBox(), - ], + child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ + Row( + children: [ + AppText( + widget.title, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.3, + height: widget.fontHeight, ), - widget.subTitle != '' - ? AppText( - widget.subTitle, - fontSize: SizeConfig.textMultiplier * 2.5, - ) - : SizedBox(), - ])), - widget.sideArrow == true - ? Expanded( - flex: 1, - child: - Icon(Icons.keyboard_arrow_right, color: Colors.red)) - : Expanded(flex: 1, child: SizedBox()), + widget.count ?? SizedBox(), + ], + ), + widget.subTitle != '' + ? AppText( + widget.subTitle, + fontSize: SizeConfig.textMultiplier * 2.5, + ) + : SizedBox(), + ])), + widget.sideArrow == true ? Expanded(flex: 1, child: Icon(Icons.keyboard_arrow_right, color: Colors.black)) : Expanded(flex: 1, child: SizedBox()), ], ), )); diff --git a/lib/widgets/text/app_texts_widget.dart b/lib/widgets/text/app_texts_widget.dart index e3c6af9a..898ea15d 100644 --- a/lib/widgets/text/app_texts_widget.dart +++ b/lib/widgets/text/app_texts_widget.dart @@ -23,6 +23,8 @@ class AppText extends StatefulWidget { final TextAlign textAlign; final Color backGroundcolor; final bool underline; + final double height; + AppText(this.data, {this.color, this.fontWeight = FontWeight.normal, @@ -37,6 +39,7 @@ class AppText extends StatefulWidget { this.visibility = true, this.textAlign, this.underline = false, + this.height, this.backGroundcolor = Colors.white}); @override @@ -50,31 +53,22 @@ class _AppTextState extends State { return Visibility( visible: widget.visibility, child: Container( - margin: widget.margin != null - ? EdgeInsets.all(widget.margin) - : EdgeInsets.only( - top: widget.marginTop, - right: widget.marginRight, - bottom: widget.marginBottom, - left: widget.marginLeft), + margin: widget.margin != null ? EdgeInsets.all(widget.margin) : EdgeInsets.only(top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft), child: Text( widget.data, textAlign: widget.textAlign, overflow: TextOverflow.clip, style: TextStyle( - color: widget.color == null - ? Theme.of(context).textTheme.bodyText1.color - : widget.color, + color: widget.color == null ? Theme.of(context).textTheme.bodyText1.color : widget.color, fontWeight: widget.fontWeight, fontSize: widget.fontSize ?? (SizeConfig.textMultiplier * 2), + height: widget.height, fontFamily: widget.fontFamily == null ? projectViewModel.isArabic ? 'Cairo' : 'WorkSans' : widget.fontFamily, - decoration: widget.underline == true - ? TextDecoration.underline - : TextDecoration.none + decoration: widget.underline == true ? TextDecoration.underline : TextDecoration.none // backgroundColor:widget.backGroundcolor ), ),