From 670991eca49c1363597999cb96d702277ff1341d Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 2 May 2023 18:06:10 +0300 Subject: [PATCH 1/2] Lab result fix --- lib/pages/login/register.dart | 235 +++++++++--------- .../medical/labs/laboratory_result_page.dart | 17 +- .../data_display/medical/doctor_card.dart | 2 +- 3 files changed, 134 insertions(+), 120 deletions(-) diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index bdb2b623..04b38e67 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/analytics/flows/login_registration.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_user_status_reponse.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_user_status_req.dart'; @@ -56,125 +55,127 @@ class _Register extends State { @override Widget build(BuildContext context) { return AppScaffold( - - appBarTitle: TranslationBase.of(context).register, - isShowAppBar: false, - isShowDecPage: false, - showNewAppBar: false, - showNewAppBarTitle: true, - body: Column( - children: [ - Expanded( - child: ListView( - padding: EdgeInsets.all(21), - physics: BouncingScrollPhysics(), - children: [ - SizedBox(height: 10), - Padding( - padding: EdgeInsets.all(10), - child: Text( - TranslationBase.of(context).enterNationalId, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), - )), - SizedBox(height: 10), - PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), - SizedBox(height: 12), - Directionality(textDirection: TextDirection.ltr, child: inputWidget(TranslationBase.of(context).nationalIdNumber, "Xxxxxxxxx", nationalIDorFile)), - SizedBox(height: 20), - Row( - children: [ - Expanded( - child: Row( - children: [ - Radio( - value: 1, - groupValue: isHijri, - onChanged: (value) { - setState(() { - isHijri = value; - }); - validateForm(); - }, - ), - Text(TranslationBase.of(context).hijriDate), - ], - ), + appBarTitle: TranslationBase.of(context).register, + isShowAppBar: false, + isShowDecPage: false, + showNewAppBar: false, + showNewAppBarTitle: true, + body: Column( + children: [ + Expanded( + child: ListView( + padding: EdgeInsets.all(21), + physics: BouncingScrollPhysics(), + children: [ + SizedBox(height: 10), + Padding( + padding: EdgeInsets.all(10), + child: Text( + TranslationBase.of(context).enterNationalId, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), + )), + SizedBox(height: 10), + PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), + SizedBox(height: 12), + Directionality(textDirection: TextDirection.ltr, child: inputWidget(TranslationBase.of(context).nationalIdNumber, "Xxxxxxxxx", nationalIDorFile)), + SizedBox(height: 20), + Row( + children: [ + Expanded( + child: Row( + children: [ + Radio( + value: 1, + groupValue: isHijri, + onChanged: (value) { + setState(() { + isHijri = value; + }); + validateForm(); + }, + ), + Text(TranslationBase.of(context).hijriDate), + ], ), - Expanded( - child: Row( - children: [ - Radio( - value: 0, - groupValue: isHijri, - onChanged: (value) { - setState(() { - isHijri = value; - }); - validateForm(); - }, - ), - Text(TranslationBase.of(context).gregorianDate), - ], - ), + ), + Expanded( + child: Row( + children: [ + Radio( + value: 0, + groupValue: isHijri, + onChanged: (value) { + setState(() { + isHijri = value; + }); + validateForm(); + }, + ), + Text(TranslationBase.of(context).gregorianDate), + ], ), - ], - ), - Row(children: [ - Container( - width: SizeConfig.realScreenWidth * .9, - child: isHijri == 1 - ? Directionality( - textDirection: TextDirection.ltr, - child: inputWidget(TranslationBase.of(context).dob, "DD/MM/YYYYY", dob, - isNumber: false, - suffix: Icon( - Icons.calendar_today, - size: 16, - ))) - : Container( - child: InkWell( - onTap: () { - if (isHijri != null) _selectDate(context); - }, - child: Directionality( - textDirection: TextDirection.ltr, - child: inputWidget(TranslationBase.of(context).dob, "DD/MM/YYYYY", dobEn, - isNumber: false, - isEnable: false, - suffix: Icon( - Icons.calendar_today, - size: 16, - )))))), - ]) - ], - ), + ), + ], + ), + Row(children: [ + Container( + width: SizeConfig.realScreenWidth * .9, + child: isHijri == 1 + ? Directionality( + textDirection: TextDirection.ltr, + child: inputWidget(TranslationBase.of(context).dob, "DD/MM/YYYYY", dob, + isNumber: false, + suffix: Icon( + Icons.calendar_today, + size: 16, + ))) + : Container( + child: InkWell( + onTap: () { + if (isHijri != null) _selectDate(context); + }, + child: Directionality( + textDirection: TextDirection.ltr, + child: inputWidget(TranslationBase.of(context).dob, "DD/MM/YYYYY", dobEn, + isNumber: false, + isEnable: false, + suffix: Icon( + Icons.calendar_today, + size: 16, + )))))), + ]) + ], ), - Container( - width: double.maxFinite, - // height: 80.0, - color: Colors.white, - // margin: EdgeInsets.only(bottom: 50.0), - child: Row( - children: [ - Expanded( - child: Padding( - padding: EdgeInsets.all(10), child: DefaultButton(TranslationBase.of(context).cancel, () { - Navigator.of(context).pop(); - locator().loginRegistration.registration_cancel(step: 'enter details'); - }, textColor: Colors.white, color: Color(0xffD02127))), - ), - Expanded( - child: Padding( - padding: EdgeInsets.all(10), - child: DefaultButton(TranslationBase.of(context).next, (){ - startRegistration(); - locator().loginRegistration.registration_enter_details(); - }, textColor: Colors.white, color: isButtonDisabled == true ? Colors.grey : Color(0xff359846))), - ), - ], - ),) - ], - ),); + ), + Container( + width: double.maxFinite, + // height: 80.0, + color: Colors.white, + // margin: EdgeInsets.only(bottom: 50.0), + child: Row( + children: [ + Expanded( + child: Padding( + padding: EdgeInsets.all(10), + child: DefaultButton(TranslationBase.of(context).cancel, () { + Navigator.of(context).pop(); + locator().loginRegistration.registration_cancel(step: 'enter details'); + }, textColor: Colors.white, color: Color(0xffD02127))), + ), + Expanded( + child: Padding( + padding: EdgeInsets.all(10), + child: DefaultButton(TranslationBase.of(context).next, () { + startRegistration(); + locator().loginRegistration.registration_enter_details(); + }, textColor: Colors.white, color: isButtonDisabled == true ? Colors.grey : Color(0xff359846))), + ), + ], + ), + ) + ], + ), + ); } Future _selectDate(BuildContext context) async { diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 4bd29c19..847f979b 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -47,13 +47,26 @@ class _LaboratoryResultPageState extends State { GifLoaderDialogUtils.hideDialog(context); }, billNo: widget.patientLabOrders.invoiceNo, - details: model.patientLabSpecialResult[index].resultDataHTML, + // details: model.patientLabSpecialResult[index].resultDataHTML, + details: model.patientLabSpecialResult.isEmpty ? null : getSpecialResults(model), orderNo: widget.patientLabOrders.orderNo, patientLabOrder: widget.patientLabOrders, ), - itemCount: model.patientLabSpecialResult.length, + itemCount: 1, ), ), ); } + + String getSpecialResults(LabsViewModel model) { + String labResults = ""; + model.patientLabSpecialResult.forEach((element) { + if (element.resultDataHTML != null) { + labResults += (element.resultDataHTML + "

"); + } else { + labResults += ("
No Result Available
"); + } + }); + return labResults; + } } diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index d58dccf3..f06d508a 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -224,7 +224,7 @@ class DoctorCard extends StatelessWidget { onTap: onEmailTap, child: Icon( Icons.email, - color: Theme.of(context).primaryColor, + color: sickLeaveStatus != 3 ? Theme.of(context).primaryColor : Colors.grey[400], ), ) : onTap != null From 701eedf147363929368aba57229380fb66fa90c9 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 9 May 2023 09:58:00 +0300 Subject: [PATCH 2/2] updates --- lib/config/localized_values.dart | 6 +++--- lib/pages/login/register-info.dart | 9 ++++++--- lib/pages/login/register_new_dubai.dart | 0 lib/widgets/new_design/doctor_header.dart | 10 +++++----- 4 files changed, 14 insertions(+), 11 deletions(-) create mode 100644 lib/pages/login/register_new_dubai.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ea622e49..1c02644e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -208,7 +208,7 @@ const Map localizedValues = { "last-name": {"en": "Last Name", "ar": "إسم العائلة"}, "female": {"en": "Female", "ar": "أنثى"}, "male": {"en": "Male", "ar": "ذكر"}, - "preferred-language": {"en": "Preferred Language", "ar": "اللغة المفضلة"}, + "preferred-language": {"en": "Preferred Language *", "ar": "اللغة المفضلة *"}, "english": {"en": "English", "ar": "الإنجليزية"}, "arabic": {"en": "Arabic", "ar": "العربية"}, "locations-register": {"en": "Where do you want to create this file?", "ar": "أين تريد فتح هذا الملف؟"}, @@ -682,7 +682,7 @@ const Map localizedValues = { "ar": "توفر هذه الخدمة مجموعه من خدمات الرعايه الصحيه المنزلية و متابعه مستمره وشامله للذين لا يستطيعون الوصول للمنشات الصحيه في اماكن اقامتهم (التحاليل المخبرية – الاشعة – التطعيمات – العلاج الطبيعي) ..." }, - "email": {"en": "Email", "ar": "البريد الالكتروني"}, + "email": {"en": "Email *", "ar": "البريد الالكتروني *"}, "Book": {"en": "Book", "ar": "حجز"}, "AppointmentLabel": {"en": "Appointment", "ar": "موعد"}, "BloodType": {"en": "Blood Type", "ar": "فصيلة الدم"}, @@ -1324,7 +1324,7 @@ const Map localizedValues = { "notif-permission-title": {"en": "Could not set the water reminders", "ar": "لا يمكن ضبط اشعار شرب الماء"}, "notif-permission-msg": {"en": "To recieve water reminders, please turn on notifications in the system settings", "ar": "الرجاء تفعيل الاشعارات في الاعدادات"}, "verification_message_code": {"en": "Please enter verification code", "ar": "الرجاء إدخال رمز التحقق"}, - "select-location": {"en": "Select Location", "ar": "اختر الموقع"}, + "select-location": {"en": "Select Location *", "ar": "اختر الموقع *"}, "result-header": {"en": "Get the result in Few Hours", "ar": "احصل على النتيجة خلال عدة ساعات"}, "please_select_gender": {"en": "Please select gender", "ar": "يرجى تحديد الجنس"}, "covid-info": { diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index 5d7db69f..53d113e3 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -26,7 +26,6 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.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:hijri/hijri_calendar.dart'; import 'package:intl/intl.dart'; @@ -278,7 +277,7 @@ class _RegisterInfo extends State { Expanded( child: Padding( padding: EdgeInsets.all(10), - child: DefaultButton(TranslationBase.of(context).cancel, () { + child: DefaultButton(page == 2 ? TranslationBase.of(context).back : TranslationBase.of(context).cancel, () { Navigator.of(context).pop(); locator().loginRegistration.registration_cancel(step: page == 1 ? 'personal info' : 'other details'); }, textColor: Colors.white, color: Color(0xffD02127))), @@ -287,7 +286,11 @@ class _RegisterInfo extends State { child: Padding( padding: EdgeInsets.all(10), child: DefaultButton(page == 1 ? TranslationBase.of(context).next : TranslationBase.of(context).register, () { - nextPage(); + if (isValid() && page == 2 || page == 1) { + nextPage(); + } else { + Utils.showErrorToast(TranslationBase.of(context).validEmail); + } page == 1 ? locator().loginRegistration.registration_personal_info() : locator().loginRegistration.registration_patient_info(); }, textColor: Colors.white, color: isValid() == true && page == 2 || page == 1 ? Color(0xff359846) : Colors.grey)), ), diff --git a/lib/pages/login/register_new_dubai.dart b/lib/pages/login/register_new_dubai.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index 2c9bb42a..806cbb4a 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -302,7 +302,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[0].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), @@ -323,7 +323,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[1].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), @@ -344,7 +344,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[2].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), @@ -365,7 +365,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[3].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), @@ -387,7 +387,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[4].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ),