diff --git a/lib/analytics/analytic-events.dart b/lib/analytics/analytic-events.dart index 3e107d95..7029cad5 100644 --- a/lib/analytics/analytic-events.dart +++ b/lib/analytics/analytic-events.dart @@ -1,69 +1,72 @@ import 'package:diplomaticquarterapp/uitl/utils.dart'; -class _Event{ +class _Event { String name; String description; bool active; - _Event(dynamic map){ - name = map['name']; - description = map['description']; - active = map['active']; + _Event(dynamic map) { + if (map != null) { + name = map['name']; + description = map['description']; + active = map['active']; + } } flutterName() => 'f: $name'; } -class AnalyticEvents{ +class AnalyticEvents { static _Event get(String key) { var e = _Event(mapping[key]); - if(e == null){ - var label = labelFrom(className: key); // Convert Class Name in to Label (HomeCare -> Home Care) - e = _Event({"name": label, "active":true, "description":key}); + if (e == null) { + var label = labelFrom( + className: + key); // Convert Class Name in to Label (HomeCare -> Home Care) + e = _Event({"name": label, "active": true, "description": key}); } return e; } static var mapping = const { - "HomeHealthCarePage" : { - "active" : true, - "name" : "Home Health Care Page", - "description" : "", + "HomeHealthCarePage": { + "active": true, + "name": "Home Health Care Page", + "description": "", }, - "SplashScreen" : { - "active" : true, - "name" : "Splash Screen", - "description" : "", + "SplashScreen": { + "active": true, + "name": "Splash Screen", + "description": "", }, - "LandingPage" : { - "active" : true, - "name" : "Landing Page", - "description" : "", + "LandingPage": { + "active": true, + "name": "Landing Page", + "description": "", }, - "WelcomeLogin" : { - "active" : true, - "name" : "Welcome Login", - "description" : "", + "WelcomeLogin": { + "active": true, + "name": "Welcome Login", + "description": "", }, - "LoginType" : { - "active" : true, - "name" : "Login Type", - "description" : "", + "LoginType": { + "active": true, + "name": "Login Type", + "description": "", }, - "Login" : { - "active" : true, - "name" : "Login", - "description" : "", + "Login": { + "active": true, + "name": "Login", + "description": "", }, - "ForgotPassword" : { - "active" : true, - "name" : "Forgot Password", - "description" : "", + "ForgotPassword": { + "active": true, + "name": "Forgot Password", + "description": "", }, - "" : { - "active" : true, - "name" : "", - "description" : "", + "": { + "active": true, + "name": "", + "description": "", }, }; } - diff --git a/lib/analytics/google-analytics.dart b/lib/analytics/google-analytics.dart index f4bf8b72..0ded8cc6 100644 --- a/lib/analytics/google-analytics.dart +++ b/lib/analytics/google-analytics.dart @@ -9,28 +9,32 @@ import 'package:flutter/services.dart'; class Singleton { const Singleton(); //Constant constructor - void hello() { print('Hello world'); } + void hello() { + print('Hello world'); + } } var analytics = FirebaseAnalytics(); -class GAnalytics{ +class GAnalytics { const GAnalytics(); static GAnalytics shared = const GAnalytics(); NavObserver navObserver() => NavObserver(); } -// adb shell setprop debug.firebase.analytics.app com.ejada.hmg -> Android -class NavObserver extends RouteObserver>{ - - _sendScreenView(PageRoute route) async{ - - log(String className){ +// adb shell setprop debug.firebase.analytics.app com.ejada.hmg -> Android +class NavObserver extends RouteObserver> { + _sendScreenView(PageRoute route) async { + log(String className) { var event = AnalyticEvents.get(className); - if(event.active){ - analytics.setCurrentScreen(screenName: event.flutterName(), screenClassOverride: className).catchError( (Object error) { - debugPrint('$FirebaseAnalyticsObserver: $error'); - }, + if (event.active != null) { + analytics + .setCurrentScreen( + screenName: event.flutterName(), screenClassOverride: className) + .catchError( + (Object error) { + debugPrint('$FirebaseAnalyticsObserver: $error'); + }, test: (Object error) { return error is PlatformException; }, @@ -38,25 +42,20 @@ class NavObserver extends RouteObserver>{ } } - if(route.settings.name != null && route.settings.name.isNotEmpty && route.settings.name != "null"){ + if (route.settings.name != null && + route.settings.name.isNotEmpty && + route.settings.name != "null") { var class_ = routes[route.settings.name](0); - if(class_ != null) - log(class_.toStringShort()); - - }else if(route is FadePage){ + if (class_ != null) log(class_.toStringShort()); + } else if (route is FadePage) { var class_ = route.page; - if(class_ != null) - log(class_.toStringShort()); - - }else if(route is MaterialPageRoute){ + if (class_ != null) log(class_.toStringShort()); + } else if (route is MaterialPageRoute) { var class_ = route.builder(null); - if (class_ != null) - log(class_.toStringShort()); - - }else{ + if (class_ != null) log(class_.toStringShort()); + } else { print(""); } - } @override @@ -82,4 +81,4 @@ class NavObserver extends RouteObserver>{ // _sendScreenView(previousRoute); // } } -} \ No newline at end of file +} diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index b08442d8..b0eda939 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -467,11 +467,10 @@ const Map localizedValues = { " خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). " }, "parkingDescription": { - - "en": "Parking service is for you to scan the car location so you can find it easy on you way out. click on (scan parking) button to save the parking location, then (show my park) button will appear to show you the way for the parking. if you want to rescan parking QR just click on (Clear My Data).", - - "ar": "خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف)." - + "en": + "Parking service is for you to scan the car location so you can find it easy on you way out. click on (scan parking) button to save the parking location, then (show my park) button will appear to show you the way for the parking. if you want to rescan parking QR just click on (Clear My Data).", + "ar": + "خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف)." }, "checkinOption": {"en": "Check-In Options", "ar": "تحقق في الخيارات"}, "readBarcode": {"en": "Read Barcode", "ar": "قراءة الكود"}, @@ -1264,7 +1263,10 @@ const Map localizedValues = { "stretcher": {"en": "Stretcher", "ar": "نقالة"}, "none": {"en": "None", "ar": "لا شيء"}, "RRT-Summary": {"en": "Summary", "ar": "ملخص الطلب"}, - "Rapid-Response-Team": {"en": "Rapid Response Team", "ar": "فريق الاستجابة السريع"}, + "Rapid-Response-Team": { + "en": "Rapid Response Team", + "ar": "فريق الاستجابة السريع" + }, "rrtService": {"en": "RRT Service", "ar": "خدمة RRT"}, "bill-amount": {"en": "Bill Amount", "ar": "مبلغ الفاتورة"}, "transport-method": {"en": "Transportation Method", "ar": "طريقة النقل"}, @@ -2058,4 +2060,16 @@ const Map localizedValues = { "ar": "يرجى قبول الشروط والأحكام للمتابعة" }, "type": {"en": "Type", "ar": "اكتب"}, + "info-ereferral": { + "en": + "This service allows you to submit a Referral request from any health care providers either inside or outside the kingdom of Saudi Arabia to any of HMG Hospitals, By filling some of the patient's data and attaching the medical reports, moreover you can track the request status (Under process, Accepted or Rejected)", + "ar": + "تتيح لك هذه الخدمة إرسال طلب إحالة من أي من مقدمي الرعاية الصحية سواء داخل المملكة العربية السعودية أو خارجها إلى أي من مستشفيات HMG ، عن طريق ملء بعض بيانات المريض وإرفاق التقارير الطبية ، علاوة على ذلك يمكنك تتبع حالة الطلب ( قيد المعالجة ، مقبول أو مرفوض)" + }, + "er-consultation": { + "en": + "This service allows you to make an online virtual consultation via video call directly with the doctor from anywhere at any time.", + "ar": + "تتيح لك هذه الخدمة إجراء استشارة عبر مكالمة فيديو مباشرة مع الطبيب من أي مكان وفي أي وقت" + }, }; diff --git a/lib/core/viewModels/dashboard_view_model.dart b/lib/core/viewModels/dashboard_view_model.dart index e085e476..cd34fd70 100644 --- a/lib/core/viewModels/dashboard_view_model.dart +++ b/lib/core/viewModels/dashboard_view_model.dart @@ -2,8 +2,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; + import '../../locator.dart'; class DashboardViewModel extends BaseViewModel { @@ -13,7 +12,9 @@ class DashboardViewModel extends BaseViewModel { String get heightCm => _vitalSignService.heightCm; String booldType = "-"; - + DashboardViewModel() { + this.getPatientRadOrders(); + } // ToDoCountProviderModel toDoProvider = // Provider.of(AppGlobal.context); diff --git a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart index 9f4240fc..9007229a 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart @@ -2,13 +2,10 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -39,27 +36,28 @@ class _EReferralPageState extends State @override Widget build(BuildContext context) { return BaseView( - builder: (_, model, widget) => - AppScaffold( - isShowAppBar: true, - appBarTitle: "E-Referral", - description: "This service allows you to submit a Referral request from any health care providers either inside or outside the kingdom of Saudi Arabia to any of HMG Hospitals, By filling some of the patient's data and attaching the medical reports, moreover you can track the request status (Under process, Accepted or Rejected)", - imagesInfo: [ - ImagesInfo( - imageAr: 'assets/images/Wifi-AR.png', - imageEn: 'assets/images/wifi-EN.png', - isAsset: true) - ], - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(65.0), - child: Stack( - children: [ - Positioned( - bottom: 1, - left: 0, - right: 0, + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).ereferral, + description: TranslationBase.of(context).eReferralInfo, + imagesInfo: [ + ImagesInfo( + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/ar/1.png', + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/1.png', + ) + ], + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), child: Container( @@ -97,13 +95,19 @@ class _EReferralPageState extends State Container( width: MediaQuery.of(context).size.width * 0.37, child: Center( - child: Texts(TranslationBase.of(context).newReferral, textAlign: TextAlign.center,), + child: Texts( + TranslationBase.of(context).newReferral, + textAlign: TextAlign.center, + ), ), ), Container( width: MediaQuery.of(context).size.width * 0.37, child: Center( - child: Texts(TranslationBase.of(context).searchForReferrals , textAlign: TextAlign.center,), + child: Texts( + TranslationBase.of(context).searchForReferrals, + textAlign: TextAlign.center, + ), ), ), ], @@ -121,10 +125,8 @@ class _EReferralPageState extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - StartIndexForNewEReferral( - ), - SearchForReferralsPage( - ) + StartIndexForNewEReferral(), + SearchForReferralsPage() ], ), ) diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 355300c4..13955612 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -19,6 +19,7 @@ import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; +import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; @@ -157,7 +158,12 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () { Navigator.pop(context); - widget.goToMyProfile(); + Navigator.push( + context, + FadePage( + page: MedicalProfilePage(), + ), + ); }, imageLocation: 'assets/images/new-design/my_file_bottom_bar.png', @@ -254,8 +260,7 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () => Navigator.push( context, - FadePage( - page: EReferralPage()), + FadePage(page: EReferralPage()), ), imageLocation: 'assets/images/ereferral_service_icon.png', title: TranslationBase.of(context).ereferral, @@ -282,7 +287,7 @@ class _AllHabibMedicalServiceState extends State { title: TranslationBase.of(context).childVaccine, ), ServicesContainer( - onTap: (){ + onTap: () { Navigator.pop(context); LandingPage.shared.switchToDoFromHMGServices(); }, diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index a8cb5048..c918cae4 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:maps_launcher/maps_launcher.dart'; import 'package:provider/provider.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; class CovidDrivethruLocation extends StatefulWidget { @override @@ -26,6 +27,7 @@ class _CovidDrivethruLocationState extends State { String projectLong = ""; String projectName = ""; String projectID = ""; + List imagesInfo = List(); ProjectViewModel projectViewModel; @@ -33,6 +35,13 @@ class _CovidDrivethruLocationState extends State { void initState() { WidgetsBinding.instance .addPostFrameCallback((_) => getProjectsList(context)); + + imagesInfo.add( + ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'), + ); super.initState(); } @@ -42,6 +51,8 @@ class _CovidDrivethruLocationState extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).covidTest, isShowAppBar: true, + imagesInfo: imagesInfo, + description: TranslationBase.of(context).covidInfo, body: SingleChildScrollView( child: Container( margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), @@ -277,25 +288,24 @@ class _CovidDrivethruLocationState extends State { service .getCovidPaymentInformation(context, int.parse(projectID)) .then((res) { - GifLoaderDialogUtils.hideDialog(context); - if (res['MessageStatus'] == 1) { - setState(() { - covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson( - res['COVID19_PatientShare']); - print(covidPaymentInfoResponse.procedureNameField); - }); - Navigator.push( - context, - FadePage( - page: CovidPaymentDetails( - covidPaymentInfoResponse: covidPaymentInfoResponse, - projectID: int.parse(projectID), - ))); - } else {} - }) - .catchError((err) { - print(err); + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + setState(() { + covidPaymentInfoResponse = + CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); + print(covidPaymentInfoResponse.procedureNameField); }); + Navigator.push( + context, + FadePage( + page: CovidPaymentDetails( + covidPaymentInfoResponse: covidPaymentInfoResponse, + projectID: int.parse(projectID), + ))); + } else {} + }).catchError((err) { + print(err); + }); } getProjectsList(BuildContext context) { diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 3e51b668..7eb17b0d 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -40,16 +40,14 @@ class HomePage extends StatefulWidget { } class _HomePageState extends State { - PharmacyModuleViewModel pharmacyModuleViewModel = locator(); + PharmacyModuleViewModel pharmacyModuleViewModel = + locator(); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => () async { - model.getPatientRadOrders(); - var user = await sharedPref.getObject(USER_PROFILE); - }, + onModelReady: (model) => () async {}, builder: (_, model, wi) => AppScaffold( isShowDecPage: false, isHelp: true, @@ -68,7 +66,9 @@ class _HomePageState extends State { height: 210, decoration: BoxDecoration( image: DecorationImage( - image: ExactAssetImage('assets/images/dashboard_top_bg.png'), fit: BoxFit.cover), + image: ExactAssetImage( + 'assets/images/dashboard_top_bg.png'), + fit: BoxFit.cover), ), child: Stack( children: [ @@ -77,34 +77,43 @@ class _HomePageState extends State { left: 5, right: 5, child: Container( - width: MediaQuery.of(context).size.width * 0.8, + width: + MediaQuery.of(context).size.width * 0.8, child: Row( children: [ Expanded( child: Visibility( - visible: model.user.outSA == 1 ? false : true, + // visible: + // model.user.outSA == 1 + // ? false + // : true, child: Container( height: 125, padding: EdgeInsets.all(5), margin: EdgeInsets.all(5), decoration: BoxDecoration( image: DecorationImage( - image: - AssetImage("assets/images/new-design/covid_bg_transparent.png"), + image: AssetImage( + "assets/images/new-design/covid_bg_transparent.png"), fit: BoxFit.fill, ), - color: Colors.white.withOpacity(0.3), - borderRadius: BorderRadius.all(Radius.circular(5))), + color: Colors.white + .withOpacity(0.3), + borderRadius: BorderRadius.all( + Radius.circular(5))), child: Container( child: Column( children: [ Texts( - TranslationBase.of(context).covidTest, + TranslationBase.of(context) + .covidTest, color: Colors.white, fontWeight: FontWeight.w700, ), Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, + mainAxisAlignment: + MainAxisAlignment + .spaceAround, children: [ Container( margin: EdgeInsets.only( @@ -116,36 +125,64 @@ class _HomePageState extends State { height: 45.0), ), Container( - margin: EdgeInsets.only(top: 5.0), + margin: EdgeInsets.only( + top: 5.0), child: Column( children: [ Texts( - TranslationBase.of(context).driveThru, - fontWeight: FontWeight.w700, - color: Colors.white, + TranslationBase.of( + context) + .driveThru, + fontWeight: + FontWeight + .w700, + color: + Colors.white, ), ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(5.0), + shape: + RoundedRectangleBorder( + borderRadius: + BorderRadius + .circular( + 5.0), ), - minWidth: MediaQuery.of(context).size.width * 0.15, + minWidth: MediaQuery.of( + context) + .size + .width * + 0.15, height: 25.0, - child: RaisedButton( - color: Colors.red[800], - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), + child: + RaisedButton( + color: Colors + .red[800], + textColor: + Colors + .white, + disabledTextColor: + Colors + .white, + disabledColor: + new Color( + 0xFFbcc2c4), onPressed: () { navigateToCovidDriveThru(); }, child: Center( child: Center( - child: Center( - child: Center( - child: Texts( - TranslationBase.of(context).bookNow, - fontWeight: FontWeight.w700, - color: Colors.white, + child: + Center( + child: + Center( + child: + Texts( + TranslationBase.of(context) + .bookNow, + fontWeight: + FontWeight.w700, + color: + Colors.white, ), ), ), @@ -166,14 +203,17 @@ class _HomePageState extends State { ), Expanded( child: InkWell( - onTap: () => Navigator.push(context, FadePage(page: LiveCareHome())), + onTap: () => Navigator.push(context, + FadePage(page: LiveCareHome())), child: Container( height: 125, padding: EdgeInsets.all(15), margin: EdgeInsets.all(5), decoration: BoxDecoration( - color: Colors.white.withOpacity(0.3), - borderRadius: BorderRadius.all(Radius.circular(5))), + color: Colors.white + .withOpacity(0.3), + borderRadius: BorderRadius.all( + Radius.circular(5))), child: SvgPicture.asset( projectViewModel.isArabic ? 'assets/images/new-design/livecare_arabic_logo.svg' @@ -189,15 +229,23 @@ class _HomePageState extends State { ], ), ), - Container(width: double.infinity, height: projectViewModel.isArabic ? 110 : 80) + Container( + width: double.infinity, + height: projectViewModel.isArabic ? 110 : 80) ], ), Positioned( top: 155, left: MediaQuery.of(context).size.width * - (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03), + (MediaQuery.of(context).orientation == + Orientation.landscape + ? 0.02 + : 0.03), right: MediaQuery.of(context).size.width * - (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03), + (MediaQuery.of(context).orientation == + Orientation.landscape + ? 0.02 + : 0.03), child: (!model.isLogin) ? Container( width: double.infinity, @@ -205,10 +253,14 @@ class _HomePageState extends State { decoration: BoxDecoration( color: HexColor('#A59E9E'), shape: BoxShape.rectangle, - border: Border.all(color: Colors.transparent, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(9)), + border: Border.all( + color: Colors.transparent, width: 0.5), + borderRadius: + BorderRadius.all(Radius.circular(9)), image: DecorationImage( - image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover)), + image: ExactAssetImage( + 'assets/images/bg_graphic.png'), + fit: BoxFit.cover)), child: Container( margin: EdgeInsets.all(5), child: Column( @@ -224,30 +276,37 @@ class _HomePageState extends State { fontSize: 23, ), Texts( - TranslationBase.of(context).myMedicalFileSubTitle, + TranslationBase.of(context) + .myMedicalFileSubTitle, color: Colors.black, fontSize: 16, ), Align( - alignment: - projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight, + alignment: projectViewModel.isArabic + ? Alignment.bottomLeft + : Alignment.bottomRight, child: InkWell( onTap: () { widget.goToMyProfile(); }, child: Container( - margin: EdgeInsets.only(left: 15, right: 15), + margin: EdgeInsets.only( + left: 15, right: 15), width: 90, height: 30, decoration: BoxDecoration( color: HexColor('#D81A2E'), shape: BoxShape.rectangle, - border: Border.all(color: Colors.transparent, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(0)), + border: Border.all( + color: Colors.transparent, + width: 0.5), + borderRadius: BorderRadius.all( + Radius.circular(0)), ), child: Center( child: Texts( - TranslationBase.of(context).viewMore, + TranslationBase.of(context) + .viewMore, color: Colors.white, fontWeight: FontWeight.w700, fontSize: 12, @@ -266,10 +325,14 @@ class _HomePageState extends State { decoration: BoxDecoration( color: HexColor('#A59E9E'), shape: BoxShape.rectangle, - border: Border.all(color: Colors.transparent, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(9)), + border: Border.all( + color: Colors.transparent, width: 0.5), + borderRadius: + BorderRadius.all(Radius.circular(9)), image: DecorationImage( - image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover), + image: ExactAssetImage( + 'assets/images/bg_graphic.png'), + fit: BoxFit.cover), ), child: Container( margin: EdgeInsets.all(5), @@ -277,51 +340,81 @@ class _HomePageState extends State { children: [ Row( children: [ - if (projectViewModel.user != null && model.isLogin) + if (projectViewModel.user != null && + model.isLogin) Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ SizedBox( height: 8, ), - model.user.cRSVerificationStatus == 2 + model.user.cRSVerificationStatus == + 2 ? Row( children: [ Texts( - model.user.firstName + " " + model.user.lastName, - color: Colors.grey[100], + model.user + .firstName + + " " + + model.user + .lastName, + color: Colors + .grey[100], bold: true, fontSize: 15, ), Container( - margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0), + margin: EdgeInsets + .fromLTRB( + 8.0, + 0.0, + 8.0, + 0.0), child: SvgPicture.asset( "assets/images/new-design/verification_check.svg"), ), ], ) - : model.user.cRSVerificationStatus == 3 + : model.user.cRSVerificationStatus == + 3 ? Row( children: [ Texts( - model.user.firstName + " " + model.user.lastName, - color: Colors.grey[100], + model.user + .firstName + + " " + + model.user + .lastName, + color: Colors + .grey[100], bold: true, fontSize: 15, ), Container( - margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0), - child: SvgPicture.asset( - "assets/images/new-design/pending.svg"), + margin: EdgeInsets + .fromLTRB( + 8.0, + 0.0, + 8.0, + 0.0), + child: SvgPicture + .asset( + "assets/images/new-design/pending.svg"), ), ], ) : Row( children: [ Texts( - model.user.firstName + " " + model.user.lastName, - color: Colors.grey[100], + model.user + .firstName + + " " + + model.user + .lastName, + color: Colors + .grey[100], bold: true, fontSize: 15, ), @@ -355,14 +448,17 @@ class _HomePageState extends State { decoration: BoxDecoration( color: HexColor('#D81A2E'), shape: BoxShape.rectangle, - border: Border.all(color: Colors.transparent, width: 0.5), + border: Border.all( + color: Colors.transparent, + width: 0.5), borderRadius: BorderRadius.all( Radius.circular(5), ), ), child: Center( child: Texts( - TranslationBase.of(context).myMedicalFile, + TranslationBase.of(context) + .myMedicalFile, color: Colors.white, fontSize: 12, textAlign: TextAlign.center, @@ -401,8 +497,10 @@ class _HomePageState extends State { width: 25, height: 40, ), - Texts('${model.weightKg} ${TranslationBase.of(context).kg}', - color: Colors.white, fontSize: 17) + Texts( + '${model.weightKg} ${TranslationBase.of(context).kg}', + color: Colors.white, + fontSize: 17) ], ), ), @@ -417,7 +515,9 @@ class _HomePageState extends State { width: 35, height: 40, ), - Texts('${model.booldType}', color: Colors.white, fontSize: 17) + Texts('${model.booldType}', + color: Colors.white, + fontSize: 17) ], ), ), @@ -431,10 +531,12 @@ class _HomePageState extends State { ], ), Padding( - padding: const EdgeInsets.only(bottom: 15, right: 15, left: 15), + padding: + const EdgeInsets.only(bottom: 15, right: 15, left: 15), child: InkWell( onTap: () { - Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage())); + Navigator.of(context).push(MaterialPageRoute( + builder: (context) => PackagesHomePage())); }, child: Container( decoration: BoxDecoration( @@ -462,126 +564,132 @@ class _HomePageState extends State { if (projectViewModel.havePrivilege(64) || projectViewModel.havePrivilege(65) || projectViewModel.havePrivilege(67)) - if (model.user.outSA == 0) - Container( - margin: EdgeInsets.only(left: 15, right: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - if (projectViewModel.havePrivilege(64)) - DashboardItem( - onTap: () { - Navigator.push( - context, - FadePage( - page: HomeHealthCarePage(), - ), - ); - }, - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/home_health_care_icon.png', - width: 50, - height: 50, - ), - SizedBox( - height: 10, - ), - Texts( - TranslationBase.of(context).homeHealthCare, - textAlign: TextAlign.center, - color: Colors.white, - fontWeight: FontWeight.w700, - fontSize: SizeConfig.textMultiplier * 1.55, - ) - ], - ), + // if (model.user.outSA == 0) + Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + if (projectViewModel.havePrivilege(64)) + DashboardItem( + onTap: () { + Navigator.push( + context, + FadePage( + page: HomeHealthCarePage(), + ), + ); + }, + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/home_health_care_icon.png', + width: 50, + height: 50, + ), + SizedBox( + height: 10, + ), + Texts( + TranslationBase.of(context) + .homeHealthCare, + textAlign: TextAlign.center, + color: Colors.white, + fontWeight: FontWeight.w700, + fontSize: + SizeConfig.textMultiplier * 1.55, + ) + ], ), ), - height: MediaQuery.of(context).size.width * 0.4, - imageName: 'home_healthcare_service_bg.png', - opacity: 0.5, ), - if (projectViewModel.havePrivilege(65)) - DashboardItem( - onTap: () => getPharmacyToken(model), - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/pharmacy_logo.png', - width: 40, - height: 40, - ), - SizedBox( - height: 20, - ), - Texts( - TranslationBase.of(context).onlinePharmacy, - textAlign: TextAlign.center, - color: Colors.white, - fontWeight: FontWeight.w700, - fontSize: SizeConfig.textMultiplier * 1.55, - ) - ], - ), + height: MediaQuery.of(context).size.width * 0.4, + imageName: 'home_healthcare_service_bg.png', + opacity: 0.5, + ), + if (projectViewModel.havePrivilege(65)) + DashboardItem( + onTap: () => getPharmacyToken(model), + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/pharmacy_logo.png', + width: 40, + height: 40, + ), + SizedBox( + height: 20, + ), + Texts( + TranslationBase.of(context) + .onlinePharmacy, + textAlign: TextAlign.center, + color: Colors.white, + fontWeight: FontWeight.w700, + fontSize: + SizeConfig.textMultiplier * 1.55, + ) + ], ), ), - height: MediaQuery.of(context).size.width * 0.4, - imageName: 'al-habib_onlne_pharmacy_bg.png', ), - if (projectViewModel.havePrivilege(67)) - DashboardItem( - onTap: () { - Navigator.push( - context, - FadePage( - page: CMCPage(), - ), - ); - }, - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/comprehensive_medical_checkup_logo.png', - width: 50, - height: 50, - ), - SizedBox( - height: 10, - ), - Texts( - TranslationBase.of(context).cmcHeading, - textAlign: TextAlign.center, - color: Colors.white, - fontWeight: FontWeight.w700, - fontSize: SizeConfig.textMultiplier * 1.55, - ) - ], - ), + height: MediaQuery.of(context).size.width * 0.4, + imageName: 'al-habib_onlne_pharmacy_bg.png', + ), + if (projectViewModel.havePrivilege(67)) + DashboardItem( + onTap: () { + Navigator.push( + context, + FadePage( + page: CMCPage(), + ), + ); + }, + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/comprehensive_medical_checkup_logo.png', + width: 50, + height: 50, + ), + SizedBox( + height: 10, + ), + Texts( + TranslationBase.of(context).cmcHeading, + textAlign: TextAlign.center, + color: Colors.white, + fontWeight: FontWeight.w700, + fontSize: + SizeConfig.textMultiplier * 1.55, + ) + ], ), ), - height: MediaQuery.of(context).size.width * 0.4, - color: HexColor("#747C80"), - imageName: 'emergency_service_image.png', ), - ], - ), + height: MediaQuery.of(context).size.width * 0.4, + color: HexColor("#747C80"), + imageName: 'emergency_service_image.png', + ), + ], ), + ), SizedBox( height: 8, ), InkWell( - onTap: () => Navigator.push(context, FadePage(page: PaymentService())), + onTap: () => + Navigator.push(context, FadePage(page: PaymentService())), child: Container( margin: EdgeInsets.only(left: 15, right: 15), child: Row( @@ -602,7 +710,8 @@ class _HomePageState extends State { height: 5, ), Texts( - TranslationBase.of(context).onlinePaymentService, + TranslationBase.of(context) + .onlinePaymentService, textAlign: TextAlign.center, color: Colors.black87, bold: false, @@ -633,7 +742,8 @@ class _HomePageState extends State { height: 10, ), Texts( - TranslationBase.of(context).offersAndPackages, + TranslationBase.of(context) + .offersAndPackages, textAlign: TextAlign.center, color: Colors.black87, bold: false, @@ -673,11 +783,13 @@ class _HomePageState extends State { height: 10, ), Texts( - TranslationBase.of(context).emergencyServices, + TranslationBase.of(context) + .emergencyServices, textAlign: TextAlign.center, color: Colors.black87, bold: false, - fontSize: SizeConfig.textMultiplier * 1.7, + fontSize: + SizeConfig.textMultiplier * 1.7, ) ], ), @@ -715,7 +827,8 @@ class _HomePageState extends State { fontWeight: FontWeight.normal, ), Texts( - TranslationBase.of(context).viewAllHabibMedicalService, + TranslationBase.of(context) + .viewAllHabibMedicalService, color: Colors.white, fontWeight: FontWeight.normal, fontSize: 10, @@ -736,13 +849,15 @@ class _HomePageState extends State { opacity: 0.5, color: Colors.grey[700], width: MediaQuery.of(context).size.width * 0.45, - onTap: () => Navigator.push(context, FadePage(page: AllHabibMedicalService())), + onTap: () => Navigator.push( + context, FadePage(page: AllHabibMedicalService())), ), DashboardItem( onTap: () { // Navigator.push( // context, FadePage(page: FeedbackHomePage())); - Navigator.push(context, FadePage(page: ContactUsPage())); + Navigator.push( + context, FadePage(page: ContactUsPage())); }, child: Container( width: double.infinity, @@ -864,8 +979,10 @@ class DashboardItem extends StatelessWidget { ? DecorationImage( image: ExactAssetImage('assets/images/$imageName'), fit: BoxFit.cover, - colorFilter: - hasColorFilter ? new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn) : null, + colorFilter: hasColorFilter + ? new ColorFilter.mode( + Colors.black.withOpacity(0.2), BlendMode.dstIn) + : null, ) : null, ), diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart index bbad8d4c..d74dd6c8 100644 --- a/lib/pages/livecare/livecare_home.dart +++ b/lib/pages/livecare/livecare_home.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; class LiveCareHome extends StatefulWidget { static bool showFooterButton = true; @@ -21,6 +22,7 @@ class _LiveCareHomeState extends State bool isDataLoaded = false; bool hasLiveCareRequest = false; + List imagesInfo = List(); List erRequestHistoryList; @@ -32,7 +34,11 @@ class _LiveCareHomeState extends State erRequestHistoryList = List(); pendingERRequestHistoryList = new ErRequestHistoryList(); - + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/er-consultation_en/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/er-consultation_en/ar/0.png')); WidgetsBinding.instance.addPostFrameCallback((_) { if (!isDataLoaded) getLiveCareHistory(); }); @@ -45,6 +51,8 @@ class _LiveCareHomeState extends State return AppScaffold( appBarTitle: "LiveCare", isShowAppBar: true, + imagesInfo: imagesInfo, + description: TranslationBase.of(context).erConsultation, body: Container( child: Column(children: [ /// this is will not colored with theme data diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index c5da90d5..1c0fd13e 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -64,11 +64,6 @@ class _Login extends State { void initState() { // getDeviceToken(); super.initState(); - - if(BASE_URL.contains("uat.")){ - nationalIDorFile.text = "1231755"; - mobileNumberController.text = mobileNo = "537503378"; - } } getDeviceToken() async { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index f1a7f0b5..b26982dd 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1161,7 +1161,8 @@ class TranslationBase { String get stretcher => localizedValues['stretcher'][locale.languageCode]; String get none => localizedValues['none'][locale.languageCode]; String get RRTSummary => localizedValues['RRT-Summary'][locale.languageCode]; - String get RapidResponseTeam => localizedValues['Rapid-Response-Team'][locale.languageCode]; + String get RapidResponseTeam => + localizedValues['Rapid-Response-Team'][locale.languageCode]; String get rrtService => localizedValues['rrtService'][locale.languageCode]; String get billAmount => localizedValues['bill-amount'][locale.languageCode]; String get transportMethod => @@ -1649,6 +1650,10 @@ class TranslationBase { String get pleaseAcceptTerms => localizedValues["please-accept-terms"][locale.languageCode]; String get type => localizedValues["type"][locale.languageCode]; + String get eReferralInfo => + localizedValues["info-ereferral"][locale.languageCode]; + String get erConsultation => + localizedValues["er-consultation"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate {