From a075d53dd5370d8df02ced23b21d3d4123c4e7a6 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 30 Sep 2021 17:49:06 +0300 Subject: [PATCH] UI updates & fixes --- lib/config/localized_values.dart | 4 +- .../ActivePrescriptionReport.dart | 8 +- .../service/contactus/finadus_service.dart | 6 + .../new_Home_health_care_step_one_page.dart | 36 +--- lib/pages/ContactUs/contact_us_page.dart | 93 +++++++--- lib/pages/ContactUs/findus/findus_page.dart | 2 +- .../ContactUs/findus/hospitrals_page.dart | 2 +- .../ContactUs/findus/pharmacies_page.dart | 3 +- lib/pages/ErService/ErOptions.dart | 152 +++++------------ lib/pages/ErService/NearestEr.dart | 6 +- .../widgets/AppointmentActions.dart | 2 +- .../ActiveMedicationsPage.dart | 2 +- .../medical/balance/advance_payment_page.dart | 2 +- .../dialogs/SelectBeneficiaryDialog.dart | 6 +- .../medical/balance/my_balance_page.dart | 2 +- .../medical/my_invoices/my_invoice_page.dart | 2 +- .../medical/my_trackers/my_trackers.dart | 160 +++++------------- lib/pages/paymentService/payment_service.dart | 70 ++++---- lib/uitl/date_uitl.dart | 14 ++ lib/uitl/translations_delegate_base.dart | 3 +- .../data_display/medical/doctor_card.dart | 4 +- .../medical/medical_profile_item.dart | 41 ++--- lib/widgets/new_design/doctor_header.dart | 4 +- 23 files changed, 264 insertions(+), 360 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index dd7c8123..bc4e6869 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -375,6 +375,7 @@ const Map localizedValues = { "VitalSign": {"en": "Vital Sign", "ar": "العلامة حيوية"}, "MonthlyReports": {"en": "Monthly Reports", "ar": "تقارير شهرية"}, "km": {"en": "KMs:", "ar": "كم"}, + "km_": {"en": "KM", "ar": "كم"}, "PatientHealthSummaryReport": {"en": "Patient Health Summary Report", "ar": " ملخص التقارير الشهرية"}, "ToViewTheTermsAndConditions": {"en": "To View The Terms And Conditions Report", "ar": " عرض الشروط والأحكام "}, "ClickHere": {"en": "Click here", "ar": "أنقر هنا"}, @@ -1503,5 +1504,6 @@ const Map localizedValues = { "seeDoctorsList": {"en": "See List Of Doctors", "ar": "اعرض قائمة الأطباء"}, "covidQuestionnaire": { "en": "Please answer below questionnaire:", "ar": "الرجاء الإجابة على الاستبيان أدناه:" }, "covidBookAppo": { "en": "Booking Appointment For: ", "ar": "موعد الحجز لـ: " }, - "emptySchedule": { "en": "Doctor has no schedule.", "ar": "لا يوجد جدول حضور مسجل للطبيب" } + "emptySchedule": { "en": "Doctor has no schedule.", "ar": "لا يوجد جدول حضور مسجل للطبيب" }, + "serviceNotAvailable": { "en": "Dear, this service is not available now, please try again later", "ar": "عزيزي المراجع, هذه الخدمة غير متوفرة الان يرجى المحاوله لاحقا"} }; diff --git a/lib/core/model/active_medications/ActivePrescriptionReport.dart b/lib/core/model/active_medications/ActivePrescriptionReport.dart index 5902a34f..06aeea26 100644 --- a/lib/core/model/active_medications/ActivePrescriptionReport.dart +++ b/lib/core/model/active_medications/ActivePrescriptionReport.dart @@ -13,7 +13,7 @@ class ActivePrescriptionReport { // List image; // String imageExtension; // dynamic imageSRCUrl; - // String imageString; + String imageString; // dynamic imageThumbUrl; dynamic isCovered; String itemDescription; @@ -48,7 +48,7 @@ class ActivePrescriptionReport { // this.image, // this.imageExtension, // this.imageSRCUrl, - // this.imageString, + this.imageString, // this.imageThumbUrl, this.isCovered, this.itemDescription, @@ -83,7 +83,7 @@ class ActivePrescriptionReport { // image = json['Image'].cast(); // imageExtension = json['ImageExtension']; // imageSRCUrl = json['ImageSRCUrl']; - // imageString = json['ImageString']; + imageString = json['ImageString']; // imageThumbUrl = json['ImageThumbUrl']; isCovered = json['IsCovered']; itemDescription = json['ItemDescription']; @@ -120,7 +120,7 @@ class ActivePrescriptionReport { // data['Image'] = this.image; // data['ImageExtension'] = this.imageExtension; // data['ImageSRCUrl'] = this.imageSRCUrl; - // data['ImageString'] = this.imageString; + data['ImageString'] = this.imageString; // data['ImageThumbUrl'] = this.imageThumbUrl; data['IsCovered'] = this.isCovered; data['ItemDescription'] = this.itemDescription; diff --git a/lib/core/service/contactus/finadus_service.dart b/lib/core/service/contactus/finadus_service.dart index 1aebb7e0..8f629db7 100644 --- a/lib/core/service/contactus/finadus_service.dart +++ b/lib/core/service/contactus/finadus_service.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart'; import '../base_service.dart'; @@ -14,6 +15,11 @@ class FindusService extends BaseService { Future getAllFindUsOrders() async { hasError = false; + var lat = await sharedPref.getDouble(USER_LAT); + var long = await sharedPref.getDouble(USER_LONG); + body['Latitude'] = lat ?? 0; + body['Longitude'] = long ?? 0; + await baseAppClient.post(GET_FINDUS_REQUEST, onSuccess: (dynamic response, int statusCode) { FindusModelList.clear(); diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart index 0838c43e..ffc0b065 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart @@ -117,6 +117,7 @@ class _NewHomeHealthCareStepOnePageState extends State[ - // Container( - // width: MediaQuery.of(context).size.width * 0.9, - // child: SecondaryButton( - // label: TranslationBase.of(context).next, - // disabled: this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal, - // color: Colors.grey[800], - // loading: widget.model.state == ViewState.BusyLocal, - // onTap: () async { - // await widget.model.getCustomerInfo(); - // if (widget.model.state == ViewState.ErrorLocal) { - // Utils.showErrorToast(); - // } else { - // Navigator.push( - // context, - // FadePage( - // page: NewHomeHealthCareStepTowPage(), - // ), - // ); - - // // widget.changePageViewIndex(1); - // } - // }, - // textColor: Theme.of(context).backgroundColor), - // ), - // ], - // ), - // ), ); } diff --git a/lib/pages/ContactUs/contact_us_page.dart b/lib/pages/ContactUs/contact_us_page.dart index 4e2cc334..43db6486 100644 --- a/lib/pages/ContactUs/contact_us_page.dart +++ b/lib/pages/ContactUs/contact_us_page.dart @@ -1,9 +1,13 @@ -import 'package:diplomaticquarterapp/pages/ContactUs/widgets/card_common_contat.dart'; +import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import '../../uitl/translations_delegate_base.dart'; +import 'LiveChat/livechat_page.dart'; +import 'findus/findus_page.dart'; class ContactUsPage extends StatefulWidget { @override @@ -23,39 +27,82 @@ class _ContactUsPageState extends State { @override Widget build(BuildContext context) { + List myMedicalList = myOptionsList(context); + return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).hMGServiceLabel, + appBarTitle: TranslationBase.of(context).contactUs, isShowDecPage: false, showNewAppBar: true, showNewAppBarTitle: true, backgroundColor: Color(0xffF8F8F8), - body: GridView( - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), - physics: NeverScrollableScrollPhysics(), - padding: EdgeInsets.all(21), - shrinkWrap: true, + body: Column( children: [ - CardCommonContact( - image: 'assets/images/new-design/find_us_icon.png', - text: TranslationBase.of(context).findUs, - subText: "", - type: 0, - ), - CardCommonContact( - image: 'assets/images/new-design/feedback_icon.png', - text: TranslationBase.of(context).feedback, - subText: "", - type: 1, + Container( + width: double.infinity, + height: 30, ), - CardCommonContact( - image: 'assets/images/new-design/live_chat_icon.png', - text: TranslationBase.of(context).liveChat, - subText: "", - type: 2, + Padding( + padding: EdgeInsets.only(left: 12, right: 12), + child: GridView.builder( + shrinkWrap: true, + primary: false, + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), + padding: EdgeInsets.zero, + itemCount: myMedicalList.length, + itemBuilder: (BuildContext context, int index) { + return myMedicalList[index]; + }, + ), ), ], ), ); } + + List myOptionsList(BuildContext context) { + List medical = List(); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: FindUsPage()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).findUs, + imagePath: 'assets/images/new-design/find_us_icon.png', + subTitle: null, + isPngImage: true, + ), + )); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: FeedbackHomePage()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).feedback, + imagePath: 'assets/images/new-design/feedback_icon.png', + subTitle: null, + isPngImage: true, + ), + )); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: LiveChatPage()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).liveChat, + imagePath: 'assets/images/new-design/live_chat_icon.png', + subTitle: null, + isPngImage: true, + ), + )); + + return medical; + } } diff --git a/lib/pages/ContactUs/findus/findus_page.dart b/lib/pages/ContactUs/findus/findus_page.dart index 06afe9a4..882ee506 100644 --- a/lib/pages/ContactUs/findus/findus_page.dart +++ b/lib/pages/ContactUs/findus/findus_page.dart @@ -37,7 +37,7 @@ class _FindUsPageState extends State with SingleTickerProviderStateM builder: (_, model, w) => AppScaffold( isShowAppBar: true, isShowDecPage: false, - appBarTitle: 'Locations', + appBarTitle: TranslationBase.of(context).location, showNewAppBar: true, showNewAppBarTitle: true, backgroundColor: Color(0xffF8F8F8), diff --git a/lib/pages/ContactUs/findus/hospitrals_page.dart b/lib/pages/ContactUs/findus/hospitrals_page.dart index 52c8044e..280c958b 100644 --- a/lib/pages/ContactUs/findus/hospitrals_page.dart +++ b/lib/pages/ContactUs/findus/hospitrals_page.dart @@ -82,7 +82,7 @@ class _HospitalsPageState extends State { child: Padding( padding: EdgeInsets.only(left: 12, right: 12), child: Text( - _location.locationName?.trim() ?? "", + _location.locationName?.trim().toString() + "\n" + _location.distanceInKilometers.toString() + " " + TranslationBase.of(context).km_ ?? "", style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, diff --git a/lib/pages/ContactUs/findus/pharmacies_page.dart b/lib/pages/ContactUs/findus/pharmacies_page.dart index b92dbacd..68673634 100644 --- a/lib/pages/ContactUs/findus/pharmacies_page.dart +++ b/lib/pages/ContactUs/findus/pharmacies_page.dart @@ -10,6 +10,7 @@ class PharmaciesPage extends StatefulWidget { final List findusPharmaciesModelList; PharmaciesPage({Key key, this.findusPharmaciesModelList}); + @override _PharmaciesPageState createState() => _PharmaciesPageState(); } @@ -102,7 +103,7 @@ class _PharmaciesPageState extends State { height: 4, ), Text( - _location.cityName?.trim() ?? "", + _location.cityName?.trim().toString() + "\n" + _location.distanceInKilometers.toString() + " " + TranslationBase.of(context).km_ ?? "", style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart index 827fd7bb..0a5f6ae4 100644 --- a/lib/pages/ErService/ErOptions.dart +++ b/lib/pages/ErService/ErOptions.dart @@ -1,8 +1,7 @@ - import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-main-screen.dart'; -import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart'; import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; @@ -37,7 +36,7 @@ class _ErOptionsState extends State { @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); - final rrtLocked = !projectViewModel.havePrivilege(68); + final rrtLocked = projectViewModel.havePrivilege(68); return AppScaffold( isShowAppBar: widget.isAppbar, @@ -47,129 +46,58 @@ class _ErOptionsState extends State { showNewAppBarTitle: true, backgroundColor: Color(0xffF8F8F8), body: GridView( - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), physics: NeverScrollableScrollPhysics(), padding: EdgeInsets.all(21), shrinkWrap: true, children: [ - CardCommonEr( - image: 'assets/images/new-design/AM.PNG', - text: TranslationBase.of(context).ambulancerequest, - subText: TranslationBase.of(context).requestA, + InkWell( onTap: () { Navigator.push(context, FadePage(page: AmbulanceReq())); }, + child: MedicalProfileItem( + title: TranslationBase.of(context).ambulancerequest, + imagePath: 'assets/images/new-design/AM.PNG', + subTitle: TranslationBase.of(context).requestA, + isPngImage: true, + ), + ), + InkWell( + onTap: () { + Navigator.push(context, FadePage(page: NearestEr())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).nearester, + imagePath: 'assets/images/new-design/emergency_icon.png', + subTitle: TranslationBase.of(context).locationa, + isPngImage: true, + ), ), - CardCommonEr( - image: 'assets/images/new-design/emergency_icon.png', - text: TranslationBase.of(context).nearester, - subText: TranslationBase.of(context).locationa, - onTap: () { - Navigator.push(context, FadePage(page: NearestEr())); - }), - CardCommonEr( - image: 'assets/images/new-design/AM.PNG', - text: 'ED service', - subText: 'ED service', + InkWell( onTap: () { Navigator.push(context, FadePage(page: DdServicesPage())); }, + child: MedicalProfileItem( + title: "ED", + imagePath: 'assets/images/new-design/AM.PNG', + subTitle: TranslationBase.of(context).service, + isPngImage: true, + ), + ), + InkWell( + onTap: () { + Navigator.push(context, FadePage(page: RRTMainScreen())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).rrtService, + imagePath: 'assets/images/new-design/AM.PNG', + subTitle: TranslationBase.of(context).service, + isPngImage: true, + isEnable: rrtLocked, + ), ), - CardCommonEr( - locked: rrtLocked, - image: 'assets/images/new-design/AM.PNG', - text: TranslationBase.of(context).rrtService, - subText: TranslationBase.of(context).rapidResponseTeam, - onTap: () { - Navigator.push(context, FadePage(page: RRTMainScreen())); - }), ], ), - - // - // body: Container( - // margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // - // Container( - // height: 170, - // margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), - // child: Row( - // mainAxisSize: MainAxisSize.max, - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // Expanded( - // child: CardCommonEr( - // image: 'assets/images/new-design/AM.PNG', - // text: TranslationBase.of(context).ambulancerequest, - // subText: TranslationBase.of(context).requestA, - // onTap: (){ - // Navigator.push( - // context, - // FadePage( - // page: AmbulanceReq())); - // }, - // - // ), - // ), - // Expanded( - // child: CardCommonEr( - // image: 'assets/images/new-design/emergency_icon.png', - // text: TranslationBase.of(context).nearester, - // subText: TranslationBase.of(context).locationa, - // onTap:(){ - // Navigator.push( - // context, - // FadePage( - // page: NearestEr())); - // }), - // - // ) - // ], - // ), - // ), - // Container( - // margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), - // height: 170, - // child: Row( - // mainAxisSize: MainAxisSize.max, - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // Expanded( - // child: CardCommonEr( - // image: 'assets/images/new-design/AM.PNG', - // text:'ED service', - // subText: 'ED service', - // onTap: (){ - // Navigator.push( - // context, - // FadePage(page: DdServicesPage()) - // ); - // }, - // - // ), - // ), - // Expanded( - // child: CardCommonEr( - // locked: rrtLocked, - // image: 'assets/images/new-design/AM.PNG', - // text: TranslationBase.of(context).rrtService, - // subText: TranslationBase.of(context).rapidResponseTeam, - // onTap:(){ - // Navigator.push( - // context, - // FadePage( - // page: RRTMainScreen())); - // }), - // ) - // ], - // ), - // ), - // ], - // ), - // ), ); } } diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index e41100fc..c3c6564d 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -93,7 +93,7 @@ class _NearestErState extends State { GifLoaderDialogUtils.showMyDialog(context); ErService service = new ErService(); service.getProjectAvgERWaitingTimeOrders().then((response) { - if (response['MessageStatus'] == 1) { + if (response != null && response['MessageStatus'] == 1) { setState(() { projectAvgERWaitingTimeModelList.clear(); response['List_ProjectAvgERWaitingTime'].forEach((vital) { @@ -103,12 +103,14 @@ class _NearestErState extends State { }); GifLoaderDialogUtils.hideDialog(context); } else { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: TranslationBase.of(context).serviceNotAvailable); isDataLoaded = false; } }).catchError((err) { print(err); - AppToast.showErrorToast(message: err); GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err.toString()); }); } } diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 6eb8c8b4..fd402a6b 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -541,7 +541,7 @@ class _AppointmentActionsState extends State { page: VitalSignDetailsScreen( appointmentNo: appoNo, projectID: projectID, - isNotOneAppointment: true, + isNotOneAppointment: false, ))); } diff --git a/lib/pages/medical/active_medications/ActiveMedicationsPage.dart b/lib/pages/medical/active_medications/ActiveMedicationsPage.dart index 1fd7a3e4..8299cad0 100644 --- a/lib/pages/medical/active_medications/ActiveMedicationsPage.dart +++ b/lib/pages/medical/active_medications/ActiveMedicationsPage.dart @@ -54,7 +54,7 @@ class ActiveMedicationsPage extends StatelessWidget { Container( child: Card( child: Image.memory( - Utils.dataFromBase64String(model.activePrescriptionReport[index].productImageBase64), + Utils.dataFromBase64String(model.activePrescriptionReport[index].imageString), fit: BoxFit.cover, height: SizeConfig.imageSizeMultiplier * 19, width: SizeConfig.imageSizeMultiplier * 18, diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index 26971713..ddf5d0b9 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -155,7 +155,7 @@ class _AdvancePaymentPageState extends State { NewTextFields( hintText: TranslationBase.of(context).fileNumber, controller: _fileTextController, - readOnly: true, + readOnly: beneficiaryType == BeneficiaryType.OtherAccount ? false : true, ), if (beneficiaryType == BeneficiaryType.OtherAccount) SizedBox( diff --git a/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart b/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart index 01529f52..526ffaf6 100644 --- a/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart @@ -87,7 +87,7 @@ class _SelectBeneficiaryDialogState extends State { leading: Radio( value: BeneficiaryType.MyFamilyFiles, groupValue: beneficiaryType, - activeColor: Color(0xFF40ACC9), + activeColor: Color(0xffC5272D), onChanged: (BeneficiaryType value) { setState(() { beneficiaryType = value; @@ -124,7 +124,7 @@ class _SelectBeneficiaryDialogState extends State { leading: Radio( value: BeneficiaryType.OtherAccount, groupValue: beneficiaryType, - activeColor: Color(0xFF40ACC9), + activeColor: Color(0xffC5272D), onChanged: (BeneficiaryType value) { setState(() { beneficiaryType = value; @@ -158,7 +158,7 @@ class _SelectBeneficiaryDialogState extends State { fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.46, - color: Colors.red, + color: Color(0xffC5272D), ), ), ), diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart index d7336714..63ab557d 100644 --- a/lib/pages/medical/balance/my_balance_page.dart +++ b/lib/pages/medical/balance/my_balance_page.dart @@ -123,7 +123,7 @@ class MyBalancePage extends StatelessWidget { ), bottomSheet: Container( // height: MediaQuery.of(context).size.height * 0.12, - height: 70.0, + height: 85.0, color: Colors.white, width: double.infinity, padding: EdgeInsets.all(12), diff --git a/lib/pages/medical/my_invoices/my_invoice_page.dart b/lib/pages/medical/my_invoices/my_invoice_page.dart index 3879a181..174d6c1d 100644 --- a/lib/pages/medical/my_invoices/my_invoice_page.dart +++ b/lib/pages/medical/my_invoices/my_invoice_page.dart @@ -63,7 +63,7 @@ class _MyInvoicesState extends State { return DoctorCard( onTap: () => openInvoiceDetailsPage(getDentalAppointmentsResponse.listDentalAppointments[index]), isInOutPatient: true, - name: TranslationBase.of(context).dr + " " + getDentalAppointmentsResponse.listDentalAppointments[index].doctorName, + name: TranslationBase.of(context).dr.toString() + " " + (projectViewModel.isArabic ? getDentalAppointmentsResponse.listDentalAppointments[index].doctorNameN.toString() : getDentalAppointmentsResponse.listDentalAppointments[index].doctorName.toString()), billNo: getDentalAppointmentsResponse.listDentalAppointments[index].invoiceNo.toString(), profileUrl: getDentalAppointmentsResponse.listDentalAppointments[index].doctorImageURL, subName: getDentalAppointmentsResponse.listDentalAppointments[index].projectName, diff --git a/lib/pages/medical/my_trackers/my_trackers.dart b/lib/pages/medical/my_trackers/my_trackers.dart index 970ba3d7..7f0ac95f 100644 --- a/lib/pages/medical/my_trackers/my_trackers.dart +++ b/lib/pages/medical/my_trackers/my_trackers.dart @@ -1,14 +1,14 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_trackers/Weight/WeightHomePage.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/pages/ContactUs/widgets/card_common_contat.dart'; -import 'Weight/WeightHomePage.dart'; + import 'blood_pressure/BloodPressureHomePage.dart'; -import 'blood_suger/blood_sugar_home_page.dart'; class MyTrackers extends StatelessWidget { @override @@ -26,125 +26,51 @@ class MyTrackers extends StatelessWidget { body: SingleChildScrollView( child: Container( child: GridView( - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), physics: NeverScrollableScrollPhysics(), padding: EdgeInsets.all(21), shrinkWrap: true, children: [ - CardCommonContact( - image: 'assets/tracker/blood-suger.png', - text: TranslationBase.of(context).bloodSugar, - subText: "", - type: 3, + InkWell( + onTap: () { + Navigator.push(context, FadePage(page: BloodSugarHomePage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).bloodSugar, + imagePath: 'assets/tracker/blood-suger.png', + subTitle: null, + isPngImage: true, + width: 45.0, + height: 45.0, + ), ), - CardCommonContact( - image: 'assets/tracker/blood-pressure.png', - text: TranslationBase.of(context).bloodPressure, - subText: "", - type: 4, + InkWell( + onTap: () { + Navigator.push(context, FadePage(page: BloodPressureHomePage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).bloodPressure, + imagePath: 'assets/tracker/blood-pressure.png', + subTitle: null, + isPngImage: true, + width: 45.0, + height: 45.0, + ), ), - CardCommonContact( - image: 'assets/tracker/weight.png', - text: TranslationBase.of(context).weight, - subText: "", - type: 5, - ) - ]) - - // Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // Expanded( - // child: InkWell( - // onTap: () => Navigator.push(context, FadePage(page: BloodSugarHomePage())), - // child: Container( - // margin: EdgeInsets.all(5), - // width: MediaQuery.of(context).size.width * 0.35, - // height: MediaQuery.of(context).size.width * 0.35, - // decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white), - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.center, - // mainAxisAlignment: MainAxisAlignment.center, - // children: [ - // Image.asset( - // 'assets/tracker/blood-suger.png', - // width: 60.0, - // ), - // SizedBox( - // height: 15, - // ), - // Texts(TranslationBase.of(context).bloodSugar), - // ], - // ), - // ), - // ), - // ), - // Expanded( - // child: InkWell( - // onTap: () => Navigator.push(context, FadePage(page: BloodPressureHomePage())), - // child: Container( - // margin: EdgeInsets.all(5), - // width: MediaQuery.of(context).size.width * 0.35, - // height: MediaQuery.of(context).size.width * 0.35, - // decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white), - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.center, - // mainAxisAlignment: MainAxisAlignment.center, - // children: [ - // Image.asset( - // 'assets/tracker/blood-pressure.png', - // width: 60.0, - // ), - // SizedBox( - // height: 15, - // ), - // Texts(TranslationBase.of(context).bloodPressure), - // ], - // ), - // ), - // ), - // ), - // ], - // ), - // Row( - // //mainAxisAlignment: MainAxisAlignment.spaceAround, - // children: [ - // Expanded( - // child: InkWell( - // onTap: () => Navigator.push(context, FadePage(page: WeightHomePage())), - // child: Container( - // margin: EdgeInsets.all(5), - // width: MediaQuery.of(context).size.width * 0.35, - // height: MediaQuery.of(context).size.width * 0.35, - // decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white), - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.center, - // mainAxisAlignment: MainAxisAlignment.center, - // children: [ - // Image.asset( - // 'assets/tracker/weight.png', - // width: 60.0, - // ), - // SizedBox( - // height: 15, - // ), - // Texts(TranslationBase.of(context).weight), - // ], - // ), - // ), - // ), - // ), - // Expanded( - // child: Container(), - // ), - // ], - // ), - // ], - // ), - ), + InkWell( + onTap: () { + Navigator.push(context, FadePage(page: WeightHomePage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).weight, + imagePath: 'assets/tracker/weight.png', + subTitle: null, + isPngImage: true, + width: 45.0, + height: 45.0, + ), + ), + ])), ), ); } diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index 4373fab8..06d4bab7 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -1,9 +1,11 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; -import 'package:diplomaticquarterapp/pages/ContactUs/widgets/card_common_contat.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/advance_payment_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/my_balance_page.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; @@ -36,7 +38,7 @@ class PaymentService extends StatelessWidget { shrinkWrap: true, primary: false, physics: NeverScrollableScrollPhysics(), - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), padding: EdgeInsets.zero, itemCount: paymentServiceList.length, itemBuilder: (BuildContext context, int index) { @@ -55,44 +57,52 @@ class PaymentService extends StatelessWidget { List medical = List(); medical.add( - CardCommonContact( - image: 'assets/images/online_payment_icon.png', - text: TranslationBase.of(context).payment, - subText: TranslationBase.of(context).paymentOnline, - type: 6, - width: double.infinity, - height: 55.0, - projectViewModel: projectViewModel, - model: model, + InkWell( + onTap: () { + navigateToToDoPage(context); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).payment, + imagePath: 'assets/images/new-design/online_payment_icon.png', + subTitle: TranslationBase.of(context).paymentOnline, + isPngImage: true, + width: 65.0, + height: 55.0, + ), ), ); medical.add( - CardCommonContact( - image: 'assets/images/device_icon.png', - text: TranslationBase.of(context).onlineCheckIn, - subText: TranslationBase.of(context).appointment, - type: 7, - width: 70.0, - height: 60.0, - projectViewModel: projectViewModel, - model: model, + InkWell( + onTap: () { + Navigator.push(context, FadePage(page: AdvancePaymentPage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).onlineCheckIn, + imagePath: 'assets/images/device_icon.png', + subTitle: TranslationBase.of(context).appointment, + isPngImage: true, + width: 45.0, + height: 45.0, + ), ), ); medical.add( - CardCommonContact( - image: 'assets/images/check-in.png', - text: TranslationBase.of(context).hmg, - subText: TranslationBase.of(context).wallet, - type: 8, - width: 60.0, - height: 55.0, - projectViewModel: projectViewModel, - model: model, + InkWell( + onTap: () { + Navigator.push(context, FadePage(page: MyBalancePage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).hmg, + imagePath: 'assets/images/check-in.png', + subTitle: TranslationBase.of(context).wallet, + isPngImage: true, + width: 45.0, + height: 45.0, + ), ), ); - return medical; } diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 0ee09dd7..4039e5e7 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -379,6 +379,20 @@ class DateUtil { return ""; } + /// get data formatted like 26/4/2020 + /// [dateTime] convert DateTime to data formatted according to language + static String getDayMonthYearDateFormattedLang(DateTime dateTime, bool isArabic) { + if (dateTime != null) + return DateFormat('dd/MM/yyyy', isArabic ? "ar_SA" : "en_US").format(dateTime); + else + return ""; + } + + /// get data formatted like 10:30 according to lang + static String formatDateToTimeLang(DateTime date, bool isArabic) { + return DateFormat('hh:mm a', isArabic ? "ar_SA" : "en_US").format(date); + } + /// get data formatted like 26/4/2020 10:30 /// [dateTime] convert DateTime to data formatted static String getDayMonthYearHourMinuteDateFormatted(DateTime dateTime) { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index bebefd92..11372d6d 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2259,8 +2259,7 @@ class TranslationBase { String get emptySchedule => localizedValues["emptySchedule"][locale.languageCode]; - - + String get serviceNotAvailable => localizedValues["serviceNotAvailable"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index 607d7e8f..bcab455b 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -49,7 +49,7 @@ class DoctorCard extends StatelessWidget { Widget build(BuildContext context) { projectViewModel = Provider.of(context); return Container( - height: 120, + height: 128, decoration: BoxDecoration( borderRadius: BorderRadius.all( Radius.circular(10.0), @@ -130,7 +130,7 @@ class DoctorCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - DateUtil.formatDateToDate(date, projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormattedLang(date, projectViewModel.isArabic), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), ), Text( diff --git a/lib/widgets/data_display/medical/medical_profile_item.dart b/lib/widgets/data_display/medical/medical_profile_item.dart index c4c2dc03..cfe7f59f 100644 --- a/lib/widgets/data_display/medical/medical_profile_item.dart +++ b/lib/widgets/data_display/medical/medical_profile_item.dart @@ -12,8 +12,10 @@ class MedicalProfileItem extends StatelessWidget { final bool isPngImage; bool isEnable; Color imgColor; + final width; + final height; - MedicalProfileItem({@required this.imagePath, @required this.title, @required this.subTitle, hasBadge, this.isEnable = true, this.imgColor, this.isPngImage = false}); + MedicalProfileItem({@required this.imagePath, @required this.title, @required this.subTitle, hasBadge, this.isEnable = true, this.imgColor, this.isPngImage = false, this.width, this.height}); @override Widget build(BuildContext context) { @@ -43,8 +45,8 @@ class MedicalProfileItem extends StatelessWidget { isPngImage ? Image.asset( imagePath, - height: SizeConfig.widthMultiplier * 7, - width: SizeConfig.widthMultiplier * 7, + width: width != null ? width : SizeConfig.widthMultiplier * 7, + height: height != null ? height : SizeConfig.widthMultiplier * 7, color: imgColor, ) : SvgPicture.asset( @@ -64,25 +66,26 @@ class MedicalProfileItem extends StatelessWidget { height: 13 / 10, ), ), - Container( - width: double.infinity, - child: Row( - children: [ - Expanded( - child: Text( - subTitle, - maxLines: 1, - style: TextStyle( - fontSize: SizeConfig.textMultiplier * 1.4, - fontWeight: FontWeight.w600, - letterSpacing: -0.3, - height: 1, + if (subTitle != null) + Container( + width: double.infinity, + child: Row( + children: [ + Expanded( + child: Text( + subTitle, + maxLines: 1, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 1.4, + fontWeight: FontWeight.w600, + letterSpacing: -0.3, + height: 1, + ), ), ), - ), - ], + ], + ), ), - ), mFlex(1), ], ), diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index d5d5a9f2..9a906d71 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -75,12 +75,12 @@ class DoctorHeader extends StatelessWidget { children: [ if (headerModel.date != null) Text( - DateUtil.formatDateToDate(headerModel.date, projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormattedLang(headerModel.date, projectViewModel.isArabic), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), ), if (headerModel.time != null) Text( - headerModel.time ?? DateUtil.formatDateToTime(headerModel.date), + headerModel.time ?? DateUtil.formatDateToTimeLang(headerModel.date, projectViewModel.isArabic), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), ), if (headerModel?.nationalityFlagURL != null)