From f6983c138a78033619bc25cb66ff7c3c78f2b606 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 22 Dec 2020 13:33:01 +0200 Subject: [PATCH 1/4] fix issues --- lib/config/config.dart | 2 +- lib/config/localized_values.dart | 5 +- .../medical/my_balance_view_model.dart | 2 - .../insurance_card_update_details.dart | 4 +- .../insurance/insurance_update_screen.dart | 137 ++++++++++++------ .../medical/reports/report_home_page.dart | 1 + lib/uitl/translations_delegate_base.dart | 1 + lib/widgets/others/not_auh_page.dart | 2 +- 8 files changed, 98 insertions(+), 56 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 62eacd03..f42d73c1 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -248,7 +248,7 @@ const UPDATE_HEALTH_TERMS = const CHANNEL = 3; const GENERAL_ID = 'Cs2020@2016\$2958'; const IP_ADDRESS = '10.20.10.20'; -const VERSION_ID = 5.6; +const VERSION_ID = 5.8; const SETUP_ID = '91877'; const LANGUAGE = 2; const PATIENT_OUT_SA = 0; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4b9c33dd..e354f5da 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1279,6 +1279,9 @@ const Map localizedValues = { "en": "You can still submit, if you don't have Insurance Image", "ar": "لا يزال بإمكانك الإرسال ، إذا لم يكن لديك صورة تأمين" }, - + "info-insur-cards": { + "en": "This service allows you to view all the insurance cards that recorded during your visits to Al Habib Medical Group in addition to:", + "ar": "خدمة بطاقات التامين: هذه الخدمة تمكنك من الاطلاع على جميع بطاقات التامين والتي تم تسجيلها اثناء زياراتك لمجموعة الحبيب الطبية بالاضافة الى:" + }, }; diff --git a/lib/core/viewModels/medical/my_balance_view_model.dart b/lib/core/viewModels/medical/my_balance_view_model.dart index 34244ee1..f9554d94 100644 --- a/lib/core/viewModels/medical/my_balance_view_model.dart +++ b/lib/core/viewModels/medical/my_balance_view_model.dart @@ -88,8 +88,6 @@ class MyBalanceViewModel extends BaseViewModel { Future getBlood() async { setState(ViewState.Busy); await _bloodDetailsService.getAllBloodOrders(); - ; - if (_bloodDetailsService.hasError) { error = _bloodDetailsService.error; setState(ViewState.Error); diff --git a/lib/pages/insurance/insurance_card_update_details.dart b/lib/pages/insurance/insurance_card_update_details.dart index a471fea2..ec367e9f 100644 --- a/lib/pages/insurance/insurance_card_update_details.dart +++ b/lib/pages/insurance/insurance_card_update_details.dart @@ -35,9 +35,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget { AppScaffold( isShowAppBar: true, isShowDecPage: false, - appBarTitle: TranslationBase - .of(context) - .cardDetail, + appBarTitle: TranslationBase.of(context).cardDetail, body: SingleChildScrollView( child: Column( children: [ diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index 8fe82efe..d07569b7 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart'; @@ -25,11 +26,13 @@ class _InsuranceUpdateState extends State with SingleTickerProviderStateMixin { TabController _tabController; InsuranceCardService _insuranceCardService = locator(); - + List imagesInfo = List(); @override void initState() { super.initState(); _tabController = TabController(length: 2, vsync: this); + + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png')); } void dispose() { @@ -43,6 +46,9 @@ class _InsuranceUpdateState extends State builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( appBarTitle: TranslationBase.of(context).insurCards, + description: TranslationBase.of(context).infoInsurCards, + infoList: TranslationBase.of(context).infoPrescriptionsPoints, + imagesInfo: imagesInfo, isShowAppBar: true, isShowDecPage: true, baseViewModel: model, @@ -107,7 +113,8 @@ class _InsuranceUpdateState extends State children: [ Container( child: model.getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList!=null ?? + .getAllSharedRecordsByStatusList != + null ?? false ? ListView.builder( itemCount: model.getAllSharedRecordsByStatusResponse @@ -202,11 +209,23 @@ class _InsuranceUpdateState extends State onTap: () { getDetails( projectID: 15, - patientIdentificationID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientIdenficationNumber, - setupID: '010266', - patientID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID, - name: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName - ); + patientIdentificationID: model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientIdenficationNumber, + setupID: + '010266', + patientID: model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .responseID, + name: model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientName); }, ), ), @@ -238,41 +257,45 @@ class _InsuranceUpdateState extends State CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [ - if(model.user!=null) - Expanded( - flex: 3, - child: Container( - margin: EdgeInsets.only( - top: 2.0, - left: 10.0, - right: 20.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - model.user.firstName??'' + " " + model.user.lastName??'', - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ), - SizedBox( - height: 8, - ), - Texts( - TranslationBase.of(context) - .fileno + - ": " + - model.user.patientID - .toString(), - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ) - ], + if (model.user != null) + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, + left: 10.0, + right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + model.user.firstName ?? + '' + + " " + + model.user.lastName ?? + '', + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ), + SizedBox( + height: 8, + ), + Texts( + TranslationBase.of(context) + .fileno + + ": " + + model.user.patientID + .toString(), + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ) + ], + ), ), ), - ), Expanded( flex: 2, child: Container( @@ -290,11 +313,16 @@ class _InsuranceUpdateState extends State getDetails( setupID: '010266', projectID: 15, - patientIdentificationID: model.user.patientIdentificationNo, - patientID: model.user.patientID, - name: model.user.firstName + " " + model.user.lastName - - ); + patientIdentificationID: + model.user + .patientIdentificationNo, + patientID: model + .user.patientID, + name: model.user + .firstName + + " " + + model + .user.lastName); }, ), ), @@ -425,7 +453,12 @@ class _InsuranceUpdateState extends State ); } - getDetails({String setupID, int projectID, String patientIdentificationID,int patientID,String name}) { + getDetails( + {String setupID, + int projectID, + String patientIdentificationID, + int patientID, + String name}) { GifLoaderDialogUtils.showMyDialog(context); _insuranceCardService .getPatientInsuranceDetails( @@ -436,8 +469,16 @@ class _InsuranceUpdateState extends State .then((value) { GifLoaderDialogUtils.hideDialog(context); if (_insuranceCardService.insuranceCardDetails != null) { - Navigator.push(context, - FadePage(page: InsuranceCardUpdateDetails(insuranceCardDetailsModel: _insuranceCardService.insuranceCardDetails,patientID: patientID,patientIdentificationID: patientIdentificationID,name: name,))); + Navigator.push( + context, + FadePage( + page: InsuranceCardUpdateDetails( + insuranceCardDetailsModel: + _insuranceCardService.insuranceCardDetails, + patientID: patientID, + patientIdentificationID: patientIdentificationID, + name: name, + ))); } else { AppToast.showErrorToast(message: _insuranceCardService.error); } diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index a6d241c2..1e360760 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -57,6 +57,7 @@ class _HomeReportPageState extends State builder: (_, model, widget) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).newMedReport, + title: TranslationBase.of(context).medReport, description: TranslationBase.of(context).infoMonthReport, baseViewModel: model, imagesInfo: imagesInfo, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index ade3128e..5a5ecb2e 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1064,6 +1064,7 @@ class TranslationBase { String get disagree => localizedValues['disagree'][locale.languageCode]; String get requestSent => localizedValues['request-sent'][locale.languageCode]; String get attachInsuraceImage => localizedValues['attach-insurace-image'][locale.languageCode]; + String get infoInsurCards => localizedValues['info-insur-cards'][locale.languageCode]; } diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart index 56df1c21..0dbbee43 100644 --- a/lib/widgets/others/not_auh_page.dart +++ b/lib/widgets/others/not_auh_page.dart @@ -73,7 +73,7 @@ class _NotAutPageState extends State { width: 40, height: 40, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), + borderRadius: BorderRadius.circular(20), color: Theme.of(context).primaryColor), child: Center( child: Texts('${index+1}',color: Colors.white,), From 4d8f42b517f15ecb0d7f74541d544c0942f8b13b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 22 Dec 2020 14:25:41 +0200 Subject: [PATCH 2/4] fix issues vital sign issue --- lib/config/localized_values.dart | 2 +- lib/core/service/client/base_app_client.dart | 3 +- lib/core/viewModels/dashboard_view_model.dart | 14 +++--- lib/pages/landing/home_page.dart | 1 - .../vital_sign_item_details_screen.dart | 49 ++----------------- .../others/app_expandable_notifier.dart | 17 ++++--- 6 files changed, 25 insertions(+), 61 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e354f5da..7c8ce344 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -305,7 +305,7 @@ const Map localizedValues = { "recieved-requests": {"en": "Recieved Requests", "ar": "الطلبات المستلمة"}, "manage-files": {"en": "Manage Family Files", "ar": "إدارة ملفات العائلة"}, 'oxygenation': {'en': 'Oxygenation', 'ar': 'الأوكسجين'}, - 'bodyMeasurements': {'en': 'body Mass', 'ar': 'قياسات الجسم'}, + 'bodyMeasurements': {'en': 'body Mass Index', 'ar': 'مؤشر الكتلة'}, 'temperature': {'en': 'Temperature', 'ar': 'درجة الحرارة'}, 'pulse': {'en': 'Pulse', 'ar': 'النبض'}, 'respiration': {'en': 'Respiration', 'ar': 'التنفس'}, diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 54ba6963..130e4af6 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -133,12 +133,11 @@ class BaseAppClient { parsed['SMSLoginRequired'] == true) { onSuccess(parsed, statusCode); } - else if(parsed['MessageStatus'] == 2){ + else if(parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']){ onFailure( parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } - else if (!parsed['IsAuthenticated']) { await logout(); diff --git a/lib/core/viewModels/dashboard_view_model.dart b/lib/core/viewModels/dashboard_view_model.dart index 8dad8b82..4f261c65 100644 --- a/lib/core/viewModels/dashboard_view_model.dart +++ b/lib/core/viewModels/dashboard_view_model.dart @@ -3,6 +3,7 @@ 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 { @@ -11,21 +12,22 @@ class DashboardViewModel extends BaseViewModel { String get weightKg => _vitalSignService.weightKg; String get heightCm => _vitalSignService.heightCm; - String booldType=""; + String booldType = "-"; + // ToDoCountProviderModel toDoProvider = // Provider.of(AppGlobal.context); getPatientRadOrders() async { - booldType = await sharedPref.getString(BLOOD_TYPE); if (isLogin && _vitalSignService.weightKg.isEmpty) { - setState(ViewState.Busy); + setState(ViewState.Busy); await _vitalSignService.getPatientRadOrders(); if (_vitalSignService.hasError) { error = _vitalSignService.error; - setState(ViewState.Error); - } else + setState(ViewState.ErrorLocal); + } else { + booldType = await sharedPref.getString(BLOOD_TYPE) ?? "-"; setState(ViewState.Idle); - bloadType = await sharedPref.getString(BLOOD_TYPE) ?? "-"; + } } } diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index f220c3e0..03c803b7 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -54,7 +54,6 @@ class _HomePageState extends State { return BaseView( onModelReady: (model) => model.getPatientRadOrders(), builder: (_, model, wi) => AppScaffold( - isShowDecPage: false, body: Container( width: double.infinity, diff --git a/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart index 0c786f2e..6db865b6 100644 --- a/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart @@ -23,53 +23,14 @@ class VitalSignItemDetailsScreen extends StatelessWidget { case VitalSignDetails.BodyMeasurements: VSchart = [ { - 'name': 'Height', - 'nameAr': 'الطول', + 'name': 'BMI', + 'nameAr': 'مؤشر الكتلة', 'title1': 'Date', - 'title2': 'Cm', - 'title2Ar': 'سم', - 'viewKey': 'HeightCm', - }, - { - 'name': 'Weight Kg', - 'nameAr': 'الوزن كجم', - 'title1': 'Date', - 'title2': 'Kg', - 'title2Ar': 'كجم', - 'viewKey': 'WeightKg', - }, - { - 'name': 'BMI ', - 'nameAr': 'مؤشر كتلة الجسم', - 'title1': 'Date', - 'title2': 'BodyMass', - 'title2Ar': 'كتلة الجسم', + 'title2': 'BMI', + 'title2Ar': 'الكتلة', 'viewKey': 'BodyMassIndex', }, - { - 'name': 'Head Circum Cm', - 'nameAr': 'محيط رأس سم', - 'title1': 'Date', - 'title2': 'Cm', - 'title2Ar': 'سم', - 'viewKey': 'HeadCircumCm', - }, - { - 'name': 'Ideal Body Weight (Lbs)', - 'nameAr': 'وزن الجسم المثالي (رطل)', - 'title1': 'Date', - 'title2': 'Ideal Weight', - 'title2Ar': 'الوزن المثالي', - 'viewKey': 'IdealBodyWeightLbs', - }, - { - 'name': 'Lean Body WeightLbs (Lbs)', - 'nameAr': 'رطل وزن الجسم النحيل (رطل)', - 'title1': 'Date', - 'title2': 'Lean Weight', - 'title2Ar': 'وزن خفيف', - 'viewKey': 'LeanBodyWeightLbs', - } + ]; break; diff --git a/lib/widgets/others/app_expandable_notifier.dart b/lib/widgets/others/app_expandable_notifier.dart index eb422a63..98997ec5 100644 --- a/lib/widgets/others/app_expandable_notifier.dart +++ b/lib/widgets/others/app_expandable_notifier.dart @@ -27,14 +27,21 @@ class AppExpandableNotifier extends StatefulWidget { } class _AppExpandableNotifier extends State { + @override - Widget build(BuildContext context) { + void initState() { setState(() { - if (widget.isExpand == true) { + if (widget.isExpand) { widget.expandFlag = widget.isExpand; widget.controller.expanded = true; } }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return ExpandableNotifier( child: Padding( padding: const EdgeInsets.only(left: 10, right: 10, top: 4), @@ -90,11 +97,7 @@ class _AppExpandableNotifier extends State { onPressed: () { setState(() { widget.expandFlag = !widget.expandFlag; - if (widget.expandFlag == true) { - widget.controller.expanded = true; - } else { - widget.controller.expanded = false; - } + widget.controller.expanded = widget.expandFlag; }); }), ]), From 2059b76fc15f646a549bb7d9f548dfd2fed4dc8a Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 23 Dec 2020 00:00:23 +0200 Subject: [PATCH 3/4] fix Medical profile --- assets/images/no-data-found.png | Bin 0 -> 1647 bytes lib/config/localized_values.dart | 5 +- lib/core/service/insurance_service.dart | 9 +- lib/pages/feedback/status_feedback_page.dart | 1 - .../insurance_card_update_details.dart | 449 +++++++++++------- .../insurance/insurance_update_screen.dart | 8 +- lib/pages/landing/landing_page.dart | 2 +- .../medical/balance/advance_payment_page.dart | 1 + .../medical/patient_sick_leave_page.dart | 26 +- .../prescription_items_page.dart | 2 +- .../radiology/radiology_details_page.dart | 4 +- lib/uitl/translations_delegate_base.dart | 1 + .../others/app_expandable_notifier.dart | 2 +- 13 files changed, 314 insertions(+), 196 deletions(-) create mode 100644 assets/images/no-data-found.png diff --git a/assets/images/no-data-found.png b/assets/images/no-data-found.png new file mode 100644 index 0000000000000000000000000000000000000000..a4ced5d3d22e25d78fda1b0a8453f4b7876cf826 GIT binary patch literal 1647 zcmV-#29WuQP)Px#IAvH#W=%~1DgXcg2mk?xX#fNO00031000^Q000000-yo_1ONa40RR91KA-~t z1ONa40RR91Qvd(}0B1?NJpcd&xJ z+mWbBS(&Nc>-E~ZyStZi?BnC(X=Q-7TCD+?djbx9SD7_VB%cYilIY3+C#sKLUS1A) zogIj-%v6`BZ*FeJDwPU(T!Dhzi6vzGIXOA$W;A=7jQqBj!8GKt!6zdaxWEt`?un51 z(EUY%WjKcdo%3(uxn0ELtJ7fu+5bsLmVC*T4MvYo++00HF4M*d zGzNWwCo)Owj+VqY3!1jrD8uvF zY!{s_ei9&KT64?C5g+~1zO}&Du}`9dfse=I83H2moN-LKfjmvU3;K@DLXW!K$qZ6N zho$lbn)`!(Zs87NFmUxhPrEWi`{XmbCTZT#=fc1}fh^XqX`hbvp@wD2M^+M0 zL*-ijLcl#n-63=?AQc6_NItXZpSO}P@P&XAy(jejE|5_dkyirm0j=n*x5LWvkrAh0 z;CgM*bKmq=kpwbNK)M7>$KlT;*|GIuNCwpnWQ*j}uD3~W3I@*l{px5*K-;5#qUr4sHZ*yY7 zOFnWUpRBC<1_9{RG9c&xWfS|nO(jb-`6{dd3-ROn$2bpkP+J3(1{Tlhbi&KiSzzD25d(EF%=We54wbS)AVM*IRr$2`U~rN*1`;s zmL;py3>m;MFoQ7SPX8k_VV2b?Z`;bi4dC?Ea$3L60z``snS! zbHNhOdAv|61pMgeNZ-!{S{_OgV82i|#3MK){6m5jWbOneJj=tn&=??BgYb)ZjNYLJ zi0OY=L{~6yfhJh}Edy*4VCeojE-}n(=__dBX$`=8s~1{dR&RO!)z;-LzlGbJJy6zh zSpj{{sCU-^+SMbkqGL$iZ{$0tt>e(S$zYG`YbhfiNdtp0#F%MrZEwJ6Wu7aPs=0C#|K{8U|fBVE7;} ze;&RTwX#H5A?O;hjtFEd4QiNg5b<(W{ z!C@>VnFn+XoIf2AW^_soJTGYBZSp~{Px+aEp|2A&=u)N-&;r;pzr`w5R8M;*6tw!6 zey?5xbm@T?1uft$b1|>?-H3PGsVd8mRsk)1O`^Gd$@e9!3ZP@)E>I$SDPCvTnYlS} zG5P3H2DhvonGa~Xer~Uhz get insuranceApproval => _insuranceApproval; InsuranceCardDetailsModel insuranceCardDetails; + List insuranceCardDetailsList = List(); + bool isHaveInsuranceCard = false; GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse(); @@ -142,12 +144,15 @@ class InsuranceCardService extends BaseService { Future getPatientInsuranceDetails({String setupID, int projectID, String patientIdentificationID,int patientID}) async{ error = ""; + hasError = false; insuranceCardDetails = null; + isHaveInsuranceCard = false; await baseAppClient.post(GET_PATIENT_INSURANCE_DETAILS, onSuccess: (dynamic response, int statusCode) { - insuranceCardDetails = null; + insuranceCardDetailsList.clear(); + isHaveInsuranceCard = true; response['List_PatientInsuranceDetails'].forEach((item) { - insuranceCardDetails = InsuranceCardDetailsModel.fromJson(item); + insuranceCardDetailsList.add(InsuranceCardDetailsModel.fromJson(item)); }); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/pages/feedback/status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart index ada758e9..59d68fa2 100644 --- a/lib/pages/feedback/status_feedback_page.dart +++ b/lib/pages/feedback/status_feedback_page.dart @@ -17,7 +17,6 @@ class _StatusFeedbackPageState extends State { @override Widget build(BuildContext context) { return BaseView( - allowAny: true, onModelReady: (model) => model.getCOC(), builder: (_, model, widget) => AppScaffold( baseViewModel: model, diff --git a/lib/pages/insurance/insurance_card_update_details.dart b/lib/pages/insurance/insurance_card_update_details.dart index ec367e9f..5e9db38a 100644 --- a/lib/pages/insurance/insurance_card_update_details.dart +++ b/lib/pages/insurance/insurance_card_update_details.dart @@ -15,215 +15,328 @@ import 'package:provider/provider.dart'; import 'AttachInsuranceCardImageDialog.dart'; class InsuranceCardUpdateDetails extends StatelessWidget { - final InsuranceCardDetailsModel insuranceCardDetailsModel; + final List insuranceCardDetailsModel; final String patientIdentificationID; final int patientID; final String name; - - const InsuranceCardUpdateDetails({Key key, - this.insuranceCardDetailsModel, - this.patientIdentificationID, - this.patientID, this.name}) + const InsuranceCardUpdateDetails( + {Key key, + this.insuranceCardDetailsModel, + this.patientIdentificationID, + this.patientID, + this.name}) : super(key: key); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - builder: (context, model, w) => - AppScaffold( - isShowAppBar: true, - isShowDecPage: false, - appBarTitle: TranslationBase.of(context).cardDetail, - body: SingleChildScrollView( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - width: double.maxFinite, - margin: EdgeInsets.only(left: 8, right: 8, top: 8), - height:projectViewModel.isArabic?350: 270, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(25), - color: Color(0xff515B5D), - ), - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - insuranceCardDetailsModel.memberID, - textScaleFactor: 2.1, - style: TextStyle(color: Colors.white, - letterSpacing: 8.0, - fontWeight: FontWeight.w400, - fontSize: 17), - ), - SizedBox( - height: 5, - ), - Texts( - insuranceCardDetailsModel.companyName, - color: Colors.white, - ), - SizedBox( - height: 25, - ), - Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment - .start, - children: [ - Texts(TranslationBase - .of(context) - .policyHolder, color: Colors.white), - Texts( - insuranceCardDetailsModel.memberName, - color: Colors.white), - ], - ), + builder: (context, model, w) => AppScaffold( + isShowAppBar: true, + isShowDecPage: false, + appBarTitle: TranslationBase.of(context).cardDetail, + body: SingleChildScrollView( + child: Column( + children: [ + ...List.generate( + insuranceCardDetailsModel.length, + (index) => Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + width: double.maxFinite, + margin: EdgeInsets.only(left: 8, right: 8, top: 8), + height: projectViewModel.isArabic ? 320 : 240, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(25), + color: Color(0xff515B5D), + ), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + insuranceCardDetailsModel[index].memberID, + textScaleFactor: 2.1, + style: TextStyle( + color: Colors.white, + letterSpacing: 8.0, + fontWeight: FontWeight.w400, + fontSize: 15), + ), + SizedBox( + height: 5, + ), + Texts( + insuranceCardDetailsModel[index].companyName, + fontSize: 14, + color: Colors.white, + ), + SizedBox( + height: 25, + ), + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).policyHolder, + color: Colors.white, + fontSize: 14, + ), + Texts( + insuranceCardDetailsModel[index] + .memberName, + color: Colors.white, + fontSize: 14, + ), + ], ), - Expanded( - child: Column( - children: [ - Texts(TranslationBase - .of(context) - .policyNo, color: Colors.white), - Texts(insuranceCardDetailsModel - .policyNumber, color: Colors.white), - ], - ), + ), + Expanded( + child: Column( + children: [ + Texts(TranslationBase.of(context).policyNo, + color: Colors.white), + Texts( + insuranceCardDetailsModel[index] + .policyNumber, + color: Colors.white), + ], + ), + ), + ], + ), + SizedBox( + height: 25, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context) + .expiryDateTitle, + color: Colors.white, + fontSize: 12, + ), + Texts( + insuranceCardDetailsModel[index].dOB, + color: Colors.white, + fontSize: 12, + ), + ], + ), + ), + Expanded( + child: Column( + children: [ + Texts( + TranslationBase.of(context).classTitle, + color: Colors.white, + fontSize: 12, + ), + Texts( + insuranceCardDetailsModel[index] + .subCategory, + color: Colors.white, + fontSize: 12, + ), + ], + ), + ), + Expanded( + child: Column( + children: [ + Texts( + TranslationBase.of(context).approval, + color: Colors.white, + fontSize: 12, + ), + Texts( + insuranceCardDetailsModel[index] + .approvalLimit + .toString(), + color: Colors.white, + fontSize: 12, + ), + ], ), - ], - ), - SizedBox( - height: 25, - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( + ), + ], + ) + ], + ), + ), + ), + ), + ), + if(insuranceCardDetailsModel.isEmpty) + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.all(10.0), + child: Card( + margin: EdgeInsets.fromLTRB( + 8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10), + ), + child: Container( + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, + left: 10.0, + right: 20.0), child: Column( - crossAxisAlignment: CrossAxisAlignment + crossAxisAlignment: + CrossAxisAlignment .start, - children: [ + children: [ Texts( - TranslationBase - .of(context) - .expiryDateTitle, - color: Colors.white), - Texts(insuranceCardDetailsModel.dOB, - color: Colors.white), - ], - ), - ), - Expanded( - child: Column( - children: [ - Texts(TranslationBase - .of(context) - .classTitle, color: Colors.white), + name, + fontSize: 14, + color: Colors.black, + fontWeight: + FontWeight.w500, + ), + SizedBox( + height: 8, + ), Texts( - insuranceCardDetailsModel.subCategory, - color: Colors.white), - ], - ), - ), - Expanded( - child: Column( - children: [ - Texts(TranslationBase - .of(context) - .approval, color: Colors.white), - Texts(insuranceCardDetailsModel - .approvalLimit - .toString(), color: Colors.white), + TranslationBase.of( + context) + .fileno + + ": " +patientID.toString(), + fontSize: 14, + color: Colors.black, + fontWeight: + FontWeight.w500, + ) ], ), ), - ], - ) - ], + ), + ], + ), ), ), ), - ) - ], - ), - ), - bottomSheet: Container( - width: double.infinity, - height: MediaQuery - .of(context) - .size - .height * 0.21, - child: Container( - margin: EdgeInsets.only(left: 8, right: 8), - child: Column( - children: [ + SizedBox(height: 150,), + Image.asset('assets/images/no-data-found.png',width: 80,height: 80,), SizedBox(height: 8,), - SecondaryButton( - textColor: Colors.white, - label: TranslationBase - .of(context) - .agree - .toUpperCase(), - color: Theme - .of(context) - .primaryColor, - onTap: () async { - GifLoaderDialogUtils.showMyDialog(context); - await model.uploadInsuranceCard(patientIdentificationID: patientIdentificationID,patientID: patientID); - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal ) { - - AppToast.showErrorToast(message: model.error); - } else { - AppToast.showSuccessToast(message: TranslationBase.of(context).requestSent); - } - }, - ), - SizedBox(height: 12,), - SecondaryButton( - textColor: Colors.white, - label: TranslationBase - .of(context) - .disagree - .toUpperCase(), - color: Colors.grey[800], - onTap: () async { - confirmSelectFamilyDialog(context: context, name: name, fileNo: patientID.toString(),model: model); - }, - ) + Texts(TranslationBase.of(context).noDataAvailable) ], + ) + ], + ), + ), + bottomSheet: Container( + width: double.infinity, + height:insuranceCardDetailsModel.isEmpty? MediaQuery.of(context).size.height * 0.14:MediaQuery.of(context).size.height * 0.21, + child: Container( + margin: EdgeInsets.only(left: 8, right: 8), + child: Column( + children: [ + SizedBox( + height: 8, ), - ), + if(insuranceCardDetailsModel.isEmpty) + SecondaryButton( + textColor: Colors.white, + label: TranslationBase.of(context).scanNow.toUpperCase(), + color: Theme.of(context).primaryColor, + onTap: () async { + confirmAttachInsuranceCardImageDialogDialog( + context: context, + name: name, + fileNo: patientID.toString(), + model: model); + }, + ), + if(insuranceCardDetailsModel.isNotEmpty) + SecondaryButton( + textColor: Colors.white, + label: TranslationBase.of(context).agree.toUpperCase(), + color: Theme.of(context).primaryColor, + onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.uploadInsuranceCard( + patientIdentificationID: patientIdentificationID, + patientID: patientID); + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + AppToast.showErrorToast(message: model.error); + } else { + AppToast.showSuccessToast( + message: TranslationBase.of(context).requestSent); + } + }, + ),if(insuranceCardDetailsModel.isNotEmpty) + SizedBox( + height: 12, + ),if(insuranceCardDetailsModel.isNotEmpty) + SecondaryButton( + textColor: Colors.white, + label: TranslationBase.of(context).disagree.toUpperCase(), + color: Colors.grey[800], + onTap: () async { + confirmAttachInsuranceCardImageDialogDialog( + context: context, + name: name, + fileNo: patientID.toString(), + model: model); + }, + ) + ], ), ), + ), + ), ); } - void confirmSelectFamilyDialog({BuildContext context, String name, String fileNo,InsuranceViewModel model}) { + void confirmAttachInsuranceCardImageDialogDialog( + {BuildContext context, + String name, + String fileNo, + InsuranceViewModel model}) { showDialog( context: context, child: AttachInsuranceCardImageDialog( fileNo: fileNo, name: name, - image: (file, image) async{ + image: (file, image) async { GifLoaderDialogUtils.showMyDialog(context); - await model.uploadInsuranceCard(patientIdentificationID: patientIdentificationID,patientID: patientID,image: image); + await model.uploadInsuranceCard( + patientIdentificationID: patientIdentificationID, + patientID: patientID, + image: image); GifLoaderDialogUtils.hideDialog(context); if (model.state == ViewState.ErrorLocal || model.state == ViewState.Error) { - AppToast.showErrorToast(message: model.error); } else { - AppToast.showSuccessToast(message: TranslationBase.of(context).requestSent); + AppToast.showSuccessToast( + message: TranslationBase.of(context).requestSent); } Navigator.pop(context); }, diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index d07569b7..d2d715cb 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -137,8 +137,7 @@ class _InsuranceUpdateState extends State BorderRadius.circular(10), ), child: Container( - width: - MediaQuery.of(context).size.width, + width: MediaQuery.of(context).size.width, padding: EdgeInsets.all(10.0), child: Row( crossAxisAlignment: @@ -468,13 +467,12 @@ class _InsuranceUpdateState extends State patientIdentificationID: patientIdentificationID) .then((value) { GifLoaderDialogUtils.hideDialog(context); - if (_insuranceCardService.insuranceCardDetails != null) { + if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) { Navigator.push( context, FadePage( page: InsuranceCardUpdateDetails( - insuranceCardDetailsModel: - _insuranceCardService.insuranceCardDetails, + insuranceCardDetailsModel: _insuranceCardService.insuranceCardDetailsList, patientID: patientID, patientIdentificationID: patientIdentificationID, name: name, diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index fe4e82ca..a2b55e50 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -516,7 +516,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { // ); // themeNotifier.setTheme(defaultTheme); } - void checkUserStatus(token, {isLoader}) async { + void checkUserStatus(token, {isLoader = true}) async { if (isLoader) //GifLoaderDialogUtils.showMyDialog(context); authService diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index f72f18a0..7f0f799a 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -214,6 +214,7 @@ class _AdvancePaymentPageState extends State { SizedBox( height: 12, ), + if(model.user!=null) NewTextFields( hintText: TranslationBase.of(context).depositorEmail, initialValue: model.user.emailAddress, diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index d95e03af..900c9666 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/sick_leave/sick_leave.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/patient_sick_leave_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -9,6 +10,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.d import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class PatientSickLeavePage extends StatefulWidget { @override @@ -19,12 +21,16 @@ class _PatientSickLeavePageState extends State { List imagesInfo = List(); @override - Widget build(BuildContext context) { + void initState() { imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/ar/0.png')); + imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/en/0.png', + imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/ar/0.png')); + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getSickLeave(), builder: (_, model, w) => AppScaffold( @@ -40,21 +46,13 @@ class _PatientSickLeavePageState extends State { itemCount: model.sickLeaveList.length, itemBuilder: (context, index) => DoctorCard( name: model.sickLeaveList[index].doctorName, - date: DateUtil.getMonthDayYearDateFormatted( - model.sickLeaveList[index].requestDate), + date:projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(model.sickLeaveList[index].requestDate):DateUtil.getMonthDayYearDateFormatted(model.sickLeaveList[index].requestDate), profileUrl: model.sickLeaveList[index].doctorImageURL, rat: model.sickLeaveList[index].actualDoctorRate.toDouble(), subName: model.sickLeaveList[index].projectName, isInOutPatient: model.sickLeaveList[index].isInOutPatient, onEmailTap: () { showConfirmMessage(model, index); - // model.sendSickLeaveEmail( - // message: TranslationBase.of(context).emailSentSuccessfully, - // requestNo: model.sickLeaveList[index].requestNo, - // doctorName: model.sickLeaveList[index].doctorName, - // projectName: model.sickLeaveList[index].projectName, - // setupID: model.sickLeaveList[index].setupID, - // projectID: model.sickLeaveList[index].projectID); }, ), ), diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index 7eb2621b..62fb1c64 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -179,7 +179,7 @@ class PrescriptionItemsPage extends StatelessWidget { ), bottomSheet: Container( width: double.infinity, - height: MediaQuery.of(context).size.height * 0.12, + height: MediaQuery.of(context).size.height * 0.14, color: Colors.grey[100], child: Column( children: [ diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index 75279eee..f3f08cce 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -54,8 +54,8 @@ class RadiologyDetailsPage extends StatelessWidget { bottomSheet: Container( width: double.infinity, height: finalRadiology.dIAPACSURL != "" - ? MediaQuery.of(context).size.height * 0.2 - : MediaQuery.of(context).size.height * 0.15, + ? MediaQuery.of(context).size.height * 0.25 + : MediaQuery.of(context).size.height * 0.14, color: Colors.grey[100], child: Column( mainAxisSize: MainAxisSize.min, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 5a5ecb2e..2cbee1df 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1065,6 +1065,7 @@ class TranslationBase { String get requestSent => localizedValues['request-sent'][locale.languageCode]; String get attachInsuraceImage => localizedValues['attach-insurace-image'][locale.languageCode]; String get infoInsurCards => localizedValues['info-insur-cards'][locale.languageCode]; + String get scanNow => localizedValues['scan-now'][locale.languageCode]; } diff --git a/lib/widgets/others/app_expandable_notifier.dart b/lib/widgets/others/app_expandable_notifier.dart index 98997ec5..c5d3ec6f 100644 --- a/lib/widgets/others/app_expandable_notifier.dart +++ b/lib/widgets/others/app_expandable_notifier.dart @@ -21,7 +21,7 @@ class AppExpandableNotifier extends StatefulWidget { this.bodyWidget, this.title, this.collapsed, - this.isExpand}); + this.isExpand = false}); _AppExpandableNotifier createState() => _AppExpandableNotifier(); } From b9958acd53588a2ea299b01547cd74b358a1c656 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 23 Dec 2020 00:33:15 +0200 Subject: [PATCH 4/4] fix issues --- .../prescriptions/prescriptions_history_details_page.dart | 2 +- lib/pages/medical/prescriptions/prescriptions_page.dart | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart b/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart index 0eac55df..22896dad 100644 --- a/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart @@ -36,7 +36,7 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget { Container( width: double.infinity, decoration: BoxDecoration( - color: prescriptionsOrder.status==3 ?Colors.red:prescriptionsOrder.status==2? Colors.green: Colors.grey, + color: prescriptionsOrder.status == 3 ?Colors.green : prescriptionsOrder.status ==2 ? Colors.grey: Colors.red, borderRadius: BorderRadius.circular(5)), child: Padding( padding: const EdgeInsets.all(8.0), diff --git a/lib/pages/medical/prescriptions/prescriptions_page.dart b/lib/pages/medical/prescriptions/prescriptions_page.dart index dc842bdc..5f16b422 100644 --- a/lib/pages/medical/prescriptions/prescriptions_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_page.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_items_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -9,6 +10,7 @@ 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:provider/provider.dart'; class PrescriptionsPage extends StatelessWidget { final PrescriptionsViewModel prescriptionsViewModel; @@ -18,6 +20,7 @@ class PrescriptionsPage extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( baseViewModel: prescriptionsViewModel, body: FractionallySizedBox( @@ -89,8 +92,7 @@ class PrescriptionsPage extends StatelessWidget { rat: prescriptions.actualDoctorRate.toDouble(), subName: prescriptions.name, isInOutPatient: prescriptions.isInOutPatient, - date: DateUtil.getMonthDayYearDateFormatted( - prescriptions.dischargeDate), + date:projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(prescriptions.dischargeDate):DateUtil.getMonthDayYearDateFormatted(prescriptions.dischargeDate), ), ); }).toList(),