From 43a672cc68637cfe0b9c561b5905a8591a98a33e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 18 Oct 2021 16:07:34 +0300 Subject: [PATCH] Updates & fixes --- .../all_habib_medical_service_page2.dart | 51 +++---- .../health-weather-indicator.dart | 141 ++++++++++-------- .../AlHabibMedicalService/my_web_view.dart | 2 + lib/pages/DrawerPages/family/my-family.dart | 8 +- lib/pages/login/welcome.dart | 7 +- lib/uitl/utils_new.dart | 14 ++ .../dialogs/confirm_send_email_dialog.dart | 5 +- 7 files changed, 121 insertions(+), 107 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart index 8feef0f5..6aff12d7 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart @@ -11,7 +11,6 @@ import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; @@ -51,18 +50,17 @@ class _AllHabibMedicalSevicePage2State extends State 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).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin)); + hmgServices.add(new HmgServices(2, TranslationBase.of(context).onlinePayment, TranslationBase.of(context).onlinePaymentSubtitle, "assets/images/new/paymentMethods.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).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); - hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergency, TranslationBase.of(context).services2, "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(4, TranslationBase.of(context).cmcTitle, TranslationBase.of(context).cmcSubtitle, "assets/images/new/comprehensive_checkup.svg", isLogin)); + hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); + hmgServices.add(new HmgServices(6, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "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)); - + hmgServices.add(new HmgServices(8, TranslationBase.of(context).findUs, TranslationBase.of(context).reachUs, "assets/images/new/reach_us.svg", isLogin)); hmgServices.add(new HmgServices(9, TranslationBase.of(context).medicalFile, TranslationBase.of(context).My_File_Details, "assets/images/new/medical file.svg", isLogin)); hmgServices.add(new HmgServices(10, TranslationBase.of(context).book, TranslationBase.of(context).appointment, "assets/images/new/book appointment.svg", isLogin)); - hmgServices.add(new HmgServices(11, TranslationBase.of(context).pharmacy, TranslationBase.of(context).Ecommerce, "assets/images/new/Pharmacy.svg", isLogin)); - hmgServices.add(new HmgServices(12, TranslationBase.of(context).update, TranslationBase.of(context).insuranceCards, "assets/images/new/update insurance card.svg", isLogin)); + hmgServices.add(new HmgServices(11, TranslationBase.of(context).online, TranslationBase.of(context).pharmacy, "assets/images/new/Pharmacy.svg", isLogin)); + hmgServices.add(new HmgServices(12, TranslationBase.of(context).updateInsurance, TranslationBase.of(context).updateInsuranceSubtitle, "assets/images/new/update insurance card.svg", isLogin)); hmgServices.add(new HmgServices(13, TranslationBase.of(context).myFamily, TranslationBase.of(context).Family_Files, "assets/images/new/my family.svg", isLogin)); hmgServices.add(new HmgServices(14, TranslationBase.of(context).My_Child, TranslationBase.of(context).Vaccines, "assets/images/new/child vaccines.svg", isLogin)); hmgServices.add(new HmgServices(15, TranslationBase.of(context).Todo, TranslationBase.of(context).list, "assets/images/new/todo.svg", isLogin)); @@ -115,19 +113,22 @@ class _AllHabibMedicalSevicePage2State extends State Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - weather, - style: TextStyle( - fontSize: 30, - letterSpacing: -0.83, - fontWeight: FontWeight.bold, - color: Colors.white, + Directionality( + textDirection: TextDirection.ltr, + child: Text( + weather, + style: TextStyle( + fontSize: 30, + letterSpacing: -0.83, + fontWeight: FontWeight.bold, + color: Colors.white, + ), ), ), Text( - DateUtil.formatDateToDate(new DateTime.now(), false), + DateUtil.getMonthDayYearDateFormatted(new DateTime.now()), style: TextStyle( - fontSize: 10, + fontSize: 12, letterSpacing: -0.60, fontWeight: FontWeight.w600, color: Colors.white, @@ -206,20 +207,6 @@ class _AllHabibMedicalSevicePage2State extends State ); } - bool timeCalculator(int startHour, int startMint, int endHour, int endMint) { - DateTime now = DateTime.now(); - DateTime startDate = DateTime(now.year, now.month, now.day, startHour, startHour); - DateTime endDate = DateTime(now.year, now.month, now.day, endHour, endMint); - print(startDate.toString()); - print(endDate.toString()); - print(now); - print("------------"); - if (startDate.isBefore(now) && endDate.isAfter(now)) - return true; - else - return false; - } - void setLocation(Position position) { this.sharedPref.setDouble(USER_LAT, position.latitude ?? 0.0); this.sharedPref.setDouble(USER_LONG, position.longitude ?? 0.0); diff --git a/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart b/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart index a79c9d9d..b38e3f63 100644 --- a/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart +++ b/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart @@ -3,8 +3,10 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/weather/weather_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; @@ -23,12 +25,11 @@ class _HospitalsPageState extends State { AppSharedPreferences sharedPref = AppSharedPreferences(); LocationUtils locationUtils; var weather = '--'; + @override void initState() { - locationUtils = - new LocationUtils(isShowConfirmDialog: true, context: context); - WidgetsBinding.instance - .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); + locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation()); getWeather(); super.initState(); } @@ -41,82 +42,92 @@ class _HospitalsPageState extends State { allowAny: true, builder: (_, mode, widget) => AppScaffold( isShowDecPage: false, + showNewAppBar: true, + showNewAppBarTitle: true, appBarTitle: TranslationBase.of(context).healthWeatherIndicators, isShowAppBar: true, body: mode.weatherIndicatorData.length > 0 ? SingleChildScrollView( child: Column(children: [ - Container( - margin: EdgeInsets.all(8), - width: double.infinity, - height: 150, - decoration: BoxDecoration( - image: DecorationImage( - image: - ExactAssetImage('assets/images/Weather_img.png'), - fit: BoxFit.cover, - ), - borderRadius: BorderRadius.circular(8.0)), - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 10.0), - child: Row( - children: [ - Expanded( - flex: 3, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .healthWeatherIndicators, - color: Colors.white, + AspectRatio( + aspectRatio: 1.8, + child: Container( + width: double.infinity, + height: double.infinity, + decoration: containerRadiusWithGradient(0, + color1: timeCalculator(6, 0, 10, 59) + ? Color(0xFFB3E3FE) + : timeCalculator(11, 0, 15, 59) + ? Color(0xFFFF9E7E) + : Color(0xFF2E6686), + color2: timeCalculator(6, 0, 10, 59) + ? Color(0xFF9AC7FF) + : timeCalculator(11, 0, 15, 59) + ? Color(0xFFFECB50) + : Color(0xFF122F48)), + child: Padding( + padding: const EdgeInsets.all(30.0), + child: Stack( + alignment: projectViewModel.isArabic ? Alignment.centerLeft : Alignment.centerRight, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Directionality( + textDirection: TextDirection.ltr, + child: Text( + weather, + style: TextStyle( + fontSize: 30, + letterSpacing: -0.83, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ), + Text( + DateUtil.getMonthDayYearDateFormatted(new DateTime.now()), + style: TextStyle( + fontSize: 12, + letterSpacing: -0.60, fontWeight: FontWeight.w600, + color: Colors.white, ), - AppText( - TranslationBase.of(context) - .healthTipsBasedOnCurrentWeather, + ), + mFlex(1), + Text( + TranslationBase.of(context).healthWeatherIndicators, + style: TextStyle( + fontSize: 16, + letterSpacing: -0.96, + fontWeight: FontWeight.bold, color: Colors.white, - fontSize: 14, ), - ], - )), - Expanded( - flex: 2, - child: InkWell( - onTap: () {}, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Image.asset( - 'assets/images/Weather_ico.png', - width: 60, - height: 60, - ), - Directionality( - textDirection: TextDirection.ltr, - child: AppText(weather, - fontSize: 22, - color: Colors.white)) - ], - ), - ], - )), - ) - ], + ), + Text( + TranslationBase.of(context).healthTipsBasedOnCurrentWeather, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.72, + fontWeight: FontWeight.w600, + color: Colors.white, + ), + ), + ], + ), + Image.asset( + "assets/images/Weather_ico.png", + color: Colors.white.withOpacity(0.5), + ), + ], + ), ), ), ), Padding( padding: EdgeInsets.all(15), child: AppText( - projectViewModel.isArabic - ? mode.weatherIndicatorData[0].cityNameN - : mode.weatherIndicatorData[0].cityName, + projectViewModel.isArabic ? mode.weatherIndicatorData[0].cityNameN : mode.weatherIndicatorData[0].cityName, fontSize: 24, fontWeight: FontWeight.bold, )), diff --git a/lib/pages/AlHabibMedicalService/my_web_view.dart b/lib/pages/AlHabibMedicalService/my_web_view.dart index f6646d36..4b03c7dd 100644 --- a/lib/pages/AlHabibMedicalService/my_web_view.dart +++ b/lib/pages/AlHabibMedicalService/my_web_view.dart @@ -22,6 +22,8 @@ class MyWebView extends StatelessWidget { isShowAppBar: true, appBarTitle: title, isShowDecPage: false, + showNewAppBar: true, + showNewAppBarTitle: true, body: WebView( initialUrl: selectedUrl, javascriptMode: JavascriptMode.unrestricted, diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 0f92e285..857c680c 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -1,7 +1,7 @@ import 'dart:ui'; +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; @@ -25,18 +25,16 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; -import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:provider/provider.dart'; class MyFamily extends StatefulWidget { final bool isAppbarVisible; diff --git a/lib/pages/login/welcome.dart b/lib/pages/login/welcome.dart index 389c9dc9..26b6421c 100644 --- a/lib/pages/login/welcome.dart +++ b/lib/pages/login/welcome.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/pages/login/register.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -79,8 +80,8 @@ class _WelcomeLogin extends State { () => { Navigator.of(context).push(FadePage(page: Register())), }, - color: Color(0xffEAEAEA), - textColor: Color(0xff000000), + color: CustomColors.accentColor, + textColor: Colors.white, ), ), SizedBox(width: 8), @@ -90,7 +91,7 @@ class _WelcomeLogin extends State { () => { Navigator.of(context).push(FadePage(page: LoginType())), }, - color: Color(0xffD02127), + color: CustomColors.green, ), ), ], diff --git a/lib/uitl/utils_new.dart b/lib/uitl/utils_new.dart index 242f47ad..a02cc0bc 100644 --- a/lib/uitl/utils_new.dart +++ b/lib/uitl/utils_new.dart @@ -547,3 +547,17 @@ FontStyle getFontStyle(String fontStyle) { return FontStyle.normal; } } + +bool timeCalculator(int startHour, int startMint, int endHour, int endMint) { + DateTime now = DateTime.now(); + DateTime startDate = DateTime(now.year, now.month, now.day, startHour, startHour); + DateTime endDate = DateTime(now.year, now.month, now.day, endHour, endMint); + print(startDate.toString()); + print(endDate.toString()); + print(now); + print("------------"); + if (startDate.isBefore(now) && endDate.isAfter(now)) + return true; + else + return false; +} diff --git a/lib/widgets/dialogs/confirm_send_email_dialog.dart b/lib/widgets/dialogs/confirm_send_email_dialog.dart index 1e1baa28..0d36747b 100644 --- a/lib/widgets/dialogs/confirm_send_email_dialog.dart +++ b/lib/widgets/dialogs/confirm_send_email_dialog.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/pages/settings/settings.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -101,8 +102,8 @@ class _ConfirmSendEmailDialogState extends State { () { Navigator.pop(context); }, - textColor: Color(0xff2B353E), - color: Color(0xffEAEAEA), + textColor: Colors.white, + color: CustomColors.accentColor, ), ), SizedBox(width: 10),