diff --git a/assets/images/vital_sign_icon.png b/assets/images/medical/vital_sign_icon.png similarity index 100% rename from assets/images/vital_sign_icon.png rename to assets/images/medical/vital_sign_icon.png diff --git a/lib/config/config.dart b/lib/config/config.dart index c2c1ef77..62eacd03 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -267,6 +267,9 @@ const GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; const INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList"; +const GET_PATIENT_INSURANCE_DETAILS = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails"; +const UPLOAD_INSURANCE_CARD = 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate'; + const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 6314cebd..4b9c33dd 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1211,4 +1211,74 @@ const Map localizedValues = { "en": "Heart rate", "ar": "معدل النبض بالدقيقة" }, + "systolic-lng": { + "en": "Systolic", + "ar": "الإنقباض" + }, + "diastolic-lng": { + "en": "Diastolic", + "ar": "الإنبساط" + }, + "policy-holder": { + "en": "Policy Holder", + "ar": "حامل بطاقة التأمين" + }, + "policy-no": { + "en": "Policy Number", + "ar": "رقم سياسات" + }, + "agree": { + "en": "I agree, this is the correct information", + "ar": "موافق، هذه المعلومات صحيحة" + }, + "disagree": { + "en": "No, this is not the correct information", + "ar": "غير موافق، هذه المعلومات غير الصحيحة" + }, + "expiry-date": { + "en": "Expiry Date", + "ar": "تاريخ انتهاء الصلاحية" + }, + "class": { + "en": "Class", + "ar": "فئة" + }, + "approval": { + "en": "Approval", + "ar": "موافقة" + }, + "no-data": { + "en": "No data found", + "ar": "لاتوجد بيانات" + }, + "insurance-details": { + "en": "Insurance Details", + "ar": "تفاصيل التأمين" + }, + "nearest-hospital": { + "en": "Nearest Hospital", + "ar": "أقرب مستشفى" + }, + "request-sent": { + "en": "Request sent successfully", + "ar": "تم إرسال الطلب بنجاح" + }, + "message-sent": { + "en": "Message sent successfully", + "ar": "تم إرسال الرسالة بنجاح" + }, + "sent-on": { + "en": "Sent on", + "ar": "أرسلت في" + }, + "attach-insurace-image": { + "en": "Attach insurance card image", + "ar": "إرفاق صورة بطاقة التأمين" + }, + "upload-without-image": { + "en": "You can still submit, if you don't have Insurance Image", + "ar": "لا يزال بإمكانك الإرسال ، إذا لم يكن لديك صورة تأمين" + }, + + }; diff --git a/lib/core/model/insurance/Insurance_card_details.dart b/lib/core/model/insurance/Insurance_card_details.dart new file mode 100644 index 00000000..ddc33b2e --- /dev/null +++ b/lib/core/model/insurance/Insurance_card_details.dart @@ -0,0 +1,88 @@ +class InsuranceCardDetailsModel { + int approvalLimit; + int companyGroupID; + String companyName; + String companyRemarks; + String dOB; + int deductible; + String effectiveFrom; + String effectiveTo; + String eligabilityFailureReason; + bool isMemberEligible; + String memberID; + String memberName; + String memberStatus; + dynamic message; + String nationalId; + String policyNumber; + String responseMessage; + String room; + String subCategory; + + InsuranceCardDetailsModel( + {this.approvalLimit, + this.companyGroupID, + this.companyName, + this.companyRemarks, + this.dOB, + this.deductible, + this.effectiveFrom, + this.effectiveTo, + this.eligabilityFailureReason, + this.isMemberEligible, + this.memberID, + this.memberName, + this.memberStatus, + this.message, + this.nationalId, + this.policyNumber, + this.responseMessage, + this.room, + this.subCategory}); + + InsuranceCardDetailsModel.fromJson(Map json) { + approvalLimit = json['ApprovalLimit']; + companyGroupID = json['CompanyGroupID']; + companyName = json['CompanyName']; + companyRemarks = json['CompanyRemarks']; + dOB = json['DOB']; + deductible = json['Deductible']; + effectiveFrom = json['EffectiveFrom']; + effectiveTo = json['EffectiveTo']; + eligabilityFailureReason = json['EligabilityFailureReason']; + isMemberEligible = json['IsMemberEligible']; + memberID = json['MemberID']; + memberName = json['MemberName']; + memberStatus = json['MemberStatus']; + message = json['Message']; + nationalId = json['NationalId']; + policyNumber = json['PolicyNumber']; + responseMessage = json['ResponseMessage']; + room = json['Room']; + subCategory = json['SubCategory']; + } + + Map toJson() { + final Map data = new Map(); + data['ApprovalLimit'] = this.approvalLimit; + data['CompanyGroupID'] = this.companyGroupID; + data['CompanyName'] = this.companyName; + data['CompanyRemarks'] = this.companyRemarks; + data['DOB'] = this.dOB; + data['Deductible'] = this.deductible; + data['EffectiveFrom'] = this.effectiveFrom; + data['EffectiveTo'] = this.effectiveTo; + data['EligabilityFailureReason'] = this.eligabilityFailureReason; + data['IsMemberEligible'] = this.isMemberEligible; + data['MemberID'] = this.memberID; + data['MemberName'] = this.memberName; + data['MemberStatus'] = this.memberStatus; + data['Message'] = this.message; + data['NationalId'] = this.nationalId; + data['PolicyNumber'] = this.policyNumber; + data['ResponseMessage'] = this.responseMessage; + data['Room'] = this.room; + data['SubCategory'] = this.subCategory; + return data; + } +} diff --git a/lib/core/model/insurance/insurance_card_update.dart b/lib/core/model/insurance/insurance_card_update_model.dart similarity index 100% rename from lib/core/model/insurance/insurance_card_update.dart rename to lib/core/model/insurance/insurance_card_update_model.dart diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index c5dfc90d..54ba6963 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -132,7 +132,14 @@ class BaseAppClient { } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { onSuccess(parsed, statusCode); - } else if (!parsed['IsAuthenticated']) { + } + else if(parsed['MessageStatus'] == 2){ + onFailure( + parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + } + + else if (!parsed['IsAuthenticated']) { await logout(); //helpers.showErrorToast('Your session expired Please login agian'); @@ -151,7 +158,7 @@ class BaseAppClient { onFailure('Please Check The Internet Connection', -1); } } catch (e) { - //print(e); + print(e); // if (e is String) { onFailure(e.toString(), -1); @@ -166,7 +173,7 @@ class BaseAppClient { await authenticatedUserObject.getUser(); Provider.of(AppGlobal.context, listen: false).isLogin = false; - var model = Provider.of(AppGlobal.context); + var model = Provider.of(AppGlobal.context,listen: false); _vitalSignService.weightKg = ""; _vitalSignService.heightCm = ""; model.setState(0, false); diff --git a/lib/core/service/insurance_service.dart b/lib/core/service/insurance_service.dart index 790003e9..900078d2 100644 --- a/lib/core/service/insurance_service.dart +++ b/lib/core/service/insurance_service.dart @@ -1,8 +1,9 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/insurance/Insurance_card_details.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart'; -import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update.dart'; +import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update_model.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart'; @@ -20,6 +21,8 @@ class InsuranceCardService extends BaseService { List get insuranceApproval => _insuranceApproval; + InsuranceCardDetailsModel insuranceCardDetails; + GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse(); @@ -136,4 +139,39 @@ class InsuranceCardService extends BaseService { }, body:{'CompanyID': data.companyID,'SubCategoryID':data.subCategoryID },); return Future.value(localRes); } + + Future getPatientInsuranceDetails({String setupID, int projectID, String patientIdentificationID,int patientID}) async{ + error = ""; + insuranceCardDetails = null; + await baseAppClient.post(GET_PATIENT_INSURANCE_DETAILS, + onSuccess: (dynamic response, int statusCode) { + insuranceCardDetails = null; + response['List_PatientInsuranceDetails'].forEach((item) { + insuranceCardDetails = InsuranceCardDetailsModel.fromJson(item); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body:{'SetupID': setupID,'ProjectID':projectID,'PatientIdentificationID':patientIdentificationID ,'isDentalAllowedBackend':false,'PatientID':patientID},); + + } + + Future uploadInsuranceCard({ String patientIdentificationID,int patientID,String image=""}) async{ + error = ""; + Map body = Map(); + body['PatientID']=patientID; + body['PatientType']=user.patientType; + body['MobileNo']=user.mobileNumber; + body['PatientIdentificationID']=patientIdentificationID; + body['InsuranceCardImage']= image; + + await baseAppClient.post(UPLOAD_INSURANCE_CARD, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body:body,); + + } } diff --git a/lib/core/service/medical/my_balance_service.dart b/lib/core/service/medical/my_balance_service.dart index e3be9bcf..32d3de39 100644 --- a/lib/core/service/medical/my_balance_service.dart +++ b/lib/core/service/medical/my_balance_service.dart @@ -25,6 +25,10 @@ class MyBalanceService extends BaseService { AuthenticatedUserObject authenticatedUserObject = locator(); + MyBalanceService(){ + getFamilyFiles(); + } + getPatientAdvanceBalanceAmount() async { hasError = false; super.error = ""; diff --git a/lib/core/service/pharmacies_service.dart b/lib/core/service/pharmacies_service.dart index 9fc7d3f5..dbd4fae1 100644 --- a/lib/core/service/pharmacies_service.dart +++ b/lib/core/service/pharmacies_service.dart @@ -77,7 +77,7 @@ class PharmacyService extends BaseService { hasError = false; await _getCurrentLocation(); Map body = Map(); - body['PHR_itemName'] = drugName; + body['PHR_itemName'] = drugName.trim(); body['isLoginForDoctorApp'] = true; body['isDentalAllowedBackend'] = true; body['PageSize'] = 25; diff --git a/lib/core/viewModels/base_view_model.dart b/lib/core/viewModels/base_view_model.dart index db709f6b..aab267e9 100644 --- a/lib/core/viewModels/base_view_model.dart +++ b/lib/core/viewModels/base_view_model.dart @@ -29,6 +29,11 @@ class BaseViewModel extends ChangeNotifier { if (hasListeners) notifyListeners(); } + setUser(AuthenticatedUser user){ + this.user = user; + notifyListeners(); + } + BaseViewModel() { //authenticatedUserObject.getUser(); user = authenticatedUserObject.user; diff --git a/lib/core/viewModels/dashboard_view_model.dart b/lib/core/viewModels/dashboard_view_model.dart index e98ca341..ff0e7c5e 100644 --- a/lib/core/viewModels/dashboard_view_model.dart +++ b/lib/core/viewModels/dashboard_view_model.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; @@ -10,12 +11,12 @@ class DashboardViewModel extends BaseViewModel { String get weightKg => _vitalSignService.weightKg; String get heightCm => _vitalSignService.heightCm; - String bloadType = ""; - + String booldType=""; // ToDoCountProviderModel toDoProvider = // Provider.of(AppGlobal.context); getPatientRadOrders() async { + booldType = await sharedPref.getString(BLOOD_TYPE); if (isLogin && _vitalSignService.weightKg.isEmpty) { setState(ViewState.Busy); await _vitalSignService.getPatientRadOrders(); diff --git a/lib/core/viewModels/insurance_card_View_model.dart b/lib/core/viewModels/insurance_card_View_model.dart index 7029f082..234db5d4 100644 --- a/lib/core/viewModels/insurance_card_View_model.dart +++ b/lib/core/viewModels/insurance_card_View_model.dart @@ -1,7 +1,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart'; -import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update.dart'; +import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update_model.dart'; import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; @@ -72,5 +72,14 @@ class InsuranceViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + Future uploadInsuranceCard({String patientIdentificationID, int patientID,String image =""}) async { + setState(ViewState.BusyLocal); + await _insuranceCardService.uploadInsuranceCard(patientIdentificationID: patientIdentificationID,patientID: patientID,image: image); + if (_insuranceCardService.hasError) { + error = _insuranceCardService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } } diff --git a/lib/core/viewModels/medical/my_balance_view_model.dart b/lib/core/viewModels/medical/my_balance_view_model.dart index e86ed55b..34244ee1 100644 --- a/lib/core/viewModels/medical/my_balance_view_model.dart +++ b/lib/core/viewModels/medical/my_balance_view_model.dart @@ -152,7 +152,7 @@ class MyBalanceViewModel extends BaseViewModel { Future getFamilyFiles() async { setState(ViewState.Busy); - await _myBalanceService.getSharedRecordByStatus(); + await _myBalanceService.getFamilyFiles(); if (_myBalanceService.hasError) { error = _myBalanceService.error; setState(ViewState.ErrorLocal); diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart index d84b9d61..a823c154 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart @@ -15,7 +15,7 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import '../dialogs/select_city_dialog.dart'; - +import 'dart:io'; class NewEReferralStepThreePage extends StatefulWidget { final CreateEReferralRequestModel createEReferralRequestModel; final Function changePageViewIndex; @@ -101,12 +101,17 @@ class _NewEReferralStepThreePageState extends State { InkWell( onTap: () { ImageOptions.showImageOptions(context, - (String image) { + (String image,File file) { setState(() { - EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${ medicalReportImages.length +1}.png',base64String: image ); - medicalReportImages.add(eReferralAttachment); + EReferralAttachment eReferralAttachment = + new EReferralAttachment( + fileName: + 'image ${medicalReportImages.length + 1}.png', + base64String: image); + medicalReportImages + .add(eReferralAttachment); }); - }); + }, ); }, child: Container( margin: EdgeInsets.only( @@ -158,15 +163,17 @@ class _NewEReferralStepThreePageState extends State { width: 8, ), Texts( - medicalReportImages[index].fileName, + medicalReportImages[index] + .fileName, ), ], ), InkWell( onTap: () { setState(() { - medicalReportImages - .remove(medicalReportImages[index]); + medicalReportImages.remove( + medicalReportImages[ + index]); }); }, child: Icon( @@ -262,12 +269,12 @@ class _NewEReferralStepThreePageState extends State { ], ), ), - if(isPatientInsured) - SizedBox( - height: 12, - ), + if (isPatientInsured) + SizedBox( + height: 12, + ), Opacity( - opacity: isPatientInsured?1:0, + opacity: isPatientInsured ? 1 : 0, child: Container( padding: EdgeInsets.only(top: 10), decoration: BoxDecoration( @@ -276,16 +283,21 @@ class _NewEReferralStepThreePageState extends State { ), child: Column( children: [ - InkWell( onTap: () { ImageOptions.showImageOptions(context, - (String image) { + (String image,File file) { setState(() { + EReferralAttachment + eReferralAttachment = + new EReferralAttachment( + fileName: + 'image ${medicalReportImages.length + 1}.png', + base64String: image); - EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${ medicalReportImages.length +1}.png',base64String: image ); - - insuredPatientImages=[eReferralAttachment]; + insuredPatientImages = [ + eReferralAttachment + ]; }); }); }, @@ -333,8 +345,8 @@ class _NewEReferralStepThreePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - Icon( - FontAwesomeIcons.paperclip), + Icon(FontAwesomeIcons + .paperclip), SizedBox( width: 8, ), @@ -346,8 +358,9 @@ class _NewEReferralStepThreePageState extends State { InkWell( onTap: () { setState(() { - insuredPatientImages - .remove(insuredPatientImages[index]); + insuredPatientImages.remove( + insuredPatientImages[ + index]); }); }, child: Icon( @@ -378,25 +391,37 @@ class _NewEReferralStepThreePageState extends State { textColor: Colors.white, label: "Submit", onTap: () async { - this.widget.createEReferralRequestModel.medicalReportAttachment = medicalReportImages; - this.widget.createEReferralRequestModel.insuranceCardAttachment = insuredPatientImages.length !=0?insuredPatientImages[0]:null; - this.widget.createEReferralRequestModel.isInsuredPatient = isPatientInsured; + this + .widget + .createEReferralRequestModel + .medicalReportAttachment = medicalReportImages; + this + .widget + .createEReferralRequestModel + .insuranceCardAttachment = + insuredPatientImages.length != 0 + ? insuredPatientImages[0] + : null; + this.widget.createEReferralRequestModel.isInsuredPatient = + isPatientInsured; // ToDo make the preferred Branch info dynamic - this.widget.createEReferralRequestModel.preferredBranchCode = 15; - this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital"; - - + this.widget.createEReferralRequestModel.preferredBranchCode = + 15; + this.widget.createEReferralRequestModel.preferredBranchName = + "Arryan Hospital"; // this.widget.createEReferralRequestModel.fullName= ""; - this.widget.createEReferralRequestModel.otherRelationship= ""; + this.widget.createEReferralRequestModel.otherRelationship = + ""; // this.widget.createEReferralRequestModel.; // this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital"; // this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital"; - await model.createEReferral(this.widget.createEReferralRequestModel); + await model + .createEReferral(this.widget.createEReferralRequestModel); }, loading: model.state == ViewState.BusyLocal, - disabled: medicalReportImages.length == 0 , + disabled: medicalReportImages.length == 0, ), ))); } @@ -416,12 +441,10 @@ class _NewEReferralStepThreePageState extends State { ); } - String getRelationName() { if (_selectedCity != null) return _selectedCity.description; else return "Select Relationship" /*TranslationBase.of(context).selectHospital*/; } - } diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 62dae624..7a28b3f9 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -720,6 +720,9 @@ class _MyFamily extends State with TickerProviderStateMixin { this.sharedPref.setObject(FAMILY_FILE, familyFile); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setString(TOKEN, result.authenticationTokenID); + await authenticatedUserObject.getUser(getUser: true); + Provider.of(context, listen: false).setUser( authenticatedUserObject.user); + //this.checkIfUserAgreedBefore(result), Navigator.of(context).pushNamed( HOME, diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 6f1d7871..4d511452 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -15,7 +15,8 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; - +import 'dart:convert'; +import 'dart:io'; import 'appointment_history.dart'; class SendFeedbackPage extends StatefulWidget { @@ -343,11 +344,11 @@ class _SendFeedbackPageState extends State { ), InkWell( onTap: () { - ImageOptions.showImageOptions(context, (String image) { + ImageOptions.showImageOptions(context, (String image,File file) { setState(() { images.add(image); }); - }); + } ); }, child: Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), diff --git a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart new file mode 100644 index 00000000..20e17593 --- /dev/null +++ b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart @@ -0,0 +1,147 @@ +import 'dart:io'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class AttachInsuranceCardImageDialog extends StatefulWidget { + final String name; + final String fileNo; + final Function(File file, String image) image; + + const AttachInsuranceCardImageDialog( + {Key key, this.name, this.fileNo, this.image}) + : super(key: key); + + @override + _AttachInsuranceCardImageDialogState createState() => + _AttachInsuranceCardImageDialogState(); +} + +class _AttachInsuranceCardImageDialogState + extends State { + @override + void initState() { + super.initState(); + } + + String image; + File file; + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Texts(TranslationBase.of(context).attachInsuraceImage), + Divider(), + Texts(widget.name), + SizedBox( + height: 3, + ), + Texts(TranslationBase.of(context).fileNo + " " + widget.fileNo), + SizedBox( + height: 5.0, + ), + InkWell( + onTap: () { + ImageOptions.showImageOptions(context, (String image,File file) { + setState(() { + this.image = image; + this.file = file; + }); + }); + }, + child: image == null + ? Padding( + padding: const EdgeInsets.all(18.0), + child: Container( + width: double.maxFinite, + height: 250, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + border: Border.all(color: Colors.grey, width: 1.5)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + // mainAxisAlignment: MainAxisAlignment., + children: [ + SizedBox(height: 25,), + Icon( + Icons.camera_enhance_rounded, + size: 85, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(Icons.attach_file), + Texts(TranslationBase.of(context).selectAttachment.toUpperCase()) + ], + ), + ], + ), + ), + ) + : Image.file( + file, + fit: BoxFit.fill, + height: 250, + ), + ), + SizedBox( + height: 25.0, + ), + Divider(), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + widget.image(file, image); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} diff --git a/lib/pages/insurance/insurance_card_update_details.dart b/lib/pages/insurance/insurance_card_update_details.dart new file mode 100644 index 00000000..a471fea2 --- /dev/null +++ b/lib/pages/insurance/insurance_card_update_details.dart @@ -0,0 +1,235 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/insurance/Insurance_card_details.dart'; +import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'AttachInsuranceCardImageDialog.dart'; + +class InsuranceCardUpdateDetails extends StatelessWidget { + final InsuranceCardDetailsModel insuranceCardDetailsModel; + final String patientIdentificationID; + final int patientID; + final String 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), + ], + ), + ), + Expanded( + child: Column( + children: [ + Texts(TranslationBase + .of(context) + .policyNo, color: Colors.white), + Texts(insuranceCardDetailsModel + .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), + Texts(insuranceCardDetailsModel.dOB, + color: Colors.white), + ], + ), + ), + Expanded( + child: Column( + children: [ + Texts(TranslationBase + .of(context) + .classTitle, color: Colors.white), + 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), + ], + ), + ), + ], + ) + ], + ), + ), + ), + ) + ], + ), + ), + 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: 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); + }, + ) + ], + ), + ), + ), + ), + ); + } + + void confirmSelectFamilyDialog({BuildContext context, String name, String fileNo,InsuranceViewModel model}) { + showDialog( + context: context, + child: AttachInsuranceCardImageDialog( + fileNo: fileNo, + name: name, + image: (file, image) async{ + GifLoaderDialogUtils.showMyDialog(context); + 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); + } + Navigator.pop(context); + }, + ), + ); + } +} diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index d8a0d80f..8fe82efe 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -1,8 +1,10 @@ import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; @@ -12,6 +14,8 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; +import 'insurance_card_update_details.dart'; + class InsuranceUpdate extends StatefulWidget { @override _InsuranceUpdateState createState() => _InsuranceUpdateState(); @@ -33,7 +37,6 @@ class _InsuranceUpdateState extends State _tabController.dispose(); } - //TODO implement update card Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getInsuranceUpdated(), @@ -41,6 +44,7 @@ class _InsuranceUpdateState extends State AppScaffold( appBarTitle: TranslationBase.of(context).insurCards, isShowAppBar: true, + isShowDecPage: true, baseViewModel: model, body: Scaffold( extendBodyBehindAppBar: true, @@ -102,12 +106,19 @@ class _InsuranceUpdateState extends State controller: _tabController, children: [ Container( - child: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.isNotEmpty?? false + child: model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList!=null ?? + false ? ListView.builder( itemCount: model.getAllSharedRecordsByStatusResponse .getAllSharedRecordsByStatusList.length, itemBuilder: (BuildContext context, int index) { - return model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 + return model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .status == + 3 ? Container( margin: EdgeInsets.all(10.0), child: Card( @@ -173,7 +184,6 @@ class _InsuranceUpdateState extends State ), ), ), - if (false) Expanded( flex: 2, child: Container( @@ -191,7 +201,12 @@ class _InsuranceUpdateState extends State Colors.white, onTap: () { getDetails( - model); + projectID: 15, + patientIdentificationID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientIdenficationNumber, + setupID: '010266', + patientID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID, + name: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName + ); }, ), ), @@ -207,89 +222,92 @@ class _InsuranceUpdateState extends State : Container(); }) : Container( - height: 80, - margin: EdgeInsets.all(10.0), - child: Column( - children: [ - SizedBox(height: 65,), - Container( - color: Colors.white, - 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 - .start, - children: [ - Texts( - model.user.firstName+" "+model.user.lastName, - fontSize: 14, - color: Colors.black, - fontWeight: - FontWeight.w500, + height: 80, + margin: EdgeInsets.all(10.0), + child: Column( + children: [ + SizedBox( + height: 65, + ), + Container( + color: Colors.white, + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Row( + crossAxisAlignment: + 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, + ) + ], + ), ), - SizedBox( - height: 8, + ), + Expanded( + flex: 2, + child: Container( + margin: EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: TranslationBase.of( + context) + .fetchData, + small: true, + textColor: Colors.white, + onTap: () { + getDetails( + setupID: '010266', + projectID: 15, + patientIdentificationID: model.user.patientIdentificationNo, + patientID: model.user.patientID, + name: model.user.firstName + " " + model.user.lastName + + ); + }, + ), + ), + ], + ), ), - Texts( - TranslationBase.of( - context) - .fileno + - ": " + - model.user.patientID.toString(), - fontSize: 14, - color: Colors.black, - fontWeight: - FontWeight.w500, - ) - ], - ), + ) + ], ), ), - if (false) - Expanded( - flex: 2, - child: Container( - margin: - EdgeInsets.only(top: 2.0), - child: Column( - children: [ - Container( - child: SecondaryButton( - label: TranslationBase - .of(context) - .fetchData, - small: true, - textColor: - Colors.white, - onTap: () { - getDetails( - model); - }, - ), - ), - ], - ), - ), - ) ], ), ), - ], - ), - ), ), Container( child: ListView.builder( @@ -407,12 +425,22 @@ class _InsuranceUpdateState extends State ); } - getDetails(data) { + getDetails({String setupID, int projectID, String patientIdentificationID,int patientID,String name}) { GifLoaderDialogUtils.showMyDialog(context); - _insuranceCardService.getInsuranceDetails(data).then((value) => { - GifLoaderDialogUtils.hideDialog(context), - Navigator.push(context, - FadePage(page: InsuranceCardDetails(data: value[0]['CheckList']))) - }); + _insuranceCardService + .getPatientInsuranceDetails( + setupID: setupID, + projectID: projectID, + patientID: patientID, + patientIdentificationID: patientIdentificationID) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (_insuranceCardService.insuranceCardDetails != null) { + 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/landing/home_page.dart b/lib/pages/landing/home_page.dart index dcf51b3d..f220c3e0 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -208,7 +208,7 @@ class _HomePageState extends State { children: [ Row( children: [ - if (model.user != null && model.isLogin) + if (projectViewModel.user != null && model.isLogin) Expanded( child: Column( crossAxisAlignment: @@ -218,15 +218,15 @@ class _HomePageState extends State { height: 8, ), Texts( - model.user.firstName + + projectViewModel.user.firstName + " " + - model.user.lastName, + projectViewModel.user.lastName, color: Colors.grey[100], bold: true, fontSize: 15, ), Texts( - '${model.user.patientID}', + '${projectViewModel.user.patientID}', color: Colors.white, fontSize: 14, ), @@ -234,7 +234,7 @@ class _HomePageState extends State { height: 5, ), Texts( - '${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.genderDescription} ${model.user.ageDesc}', + '${DateUtil.getMonthDayYearDateFormatted(projectViewModel.user.dateofBirthDataTime)} ,${projectViewModel.user.genderDescription} ${projectViewModel.user.ageDesc}', color: Colors.grey[100], fontWeight: FontWeight.normal, @@ -358,7 +358,7 @@ class _HomePageState extends State { Column( children: [ Texts( - '${model.bloadType}', + '${model.booldType}', color: Colors.white, ), Texts( @@ -410,7 +410,7 @@ class _HomePageState extends State { shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(12) ), - child: Center(child: Image.asset('assets/images/vital_sign_icon.png', + child: Center(child: Image.asset('assets/images/medical/vital_sign_icon.png', width: 80, height: 50, fit: BoxFit.contain,)), diff --git a/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart b/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart index 10d61f68..380f250c 100644 --- a/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart +++ b/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart @@ -175,7 +175,7 @@ class _ConfirmSMSDialogState extends State { fontSize: SizeConfig.textMultiplier * 3, ), focusNode: focusD1, - maxLength: 1, + //maxLength: 1, controller: digit1, textAlign: TextAlign.center, keyboardType: TextInputType.number, @@ -200,7 +200,7 @@ class _ConfirmSMSDialogState extends State { focusNode: focusD2, controller: digit2, textInputAction: TextInputAction.next, - maxLength: 1, + //maxLength: 1, textAlign: TextAlign.center, style: TextStyle( fontSize: SizeConfig.textMultiplier * 3, @@ -227,7 +227,7 @@ class _ConfirmSMSDialogState extends State { focusNode: focusD3, controller: digit3, textInputAction: TextInputAction.next, - maxLength: 1, + //maxLength: 1, textAlign: TextAlign.center, style: TextStyle( fontSize: SizeConfig.textMultiplier * 3, @@ -253,7 +253,7 @@ class _ConfirmSMSDialogState extends State { child: TextFormField( focusNode: focusD4, controller: digit4, - maxLength: 1, + // maxLength: 1, textAlign: TextAlign.center, style: TextStyle( fontSize: SizeConfig.textMultiplier * 3, diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 12c1baf7..f923c610 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart' import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; @@ -351,8 +352,8 @@ class _MedicalProfilePageState extends State { FadePage(page: InsuranceUpdate())); }, child: MedicalProfileItem( - title: - TranslationBase.of(context).updateInsurance, + title: TranslationBase.of(context) + .updateInsurance, imagePath: 'insurance_card_icon.png', subTitle: TranslationBase.of(context) .updateInsuranceSubtitle, @@ -360,7 +361,20 @@ class _MedicalProfilePageState extends State { ), ), Expanded( - child: Container(), + flex: 1, + child: InkWell( + onTap: () { + Navigator.push(context, + FadePage(page: VitalSignDetailsScreen())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context) + .vitalSigns, + imagePath: 'vital_sign_icon.png', + subTitle: TranslationBase.of(context) + .vitalSignsSubtitle, + ), + ), ), ]), SizedBox( diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index 7d92b47c..a6d241c2 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -138,6 +138,7 @@ class _HomeReportPageState extends State ), body: Column( children: [ + if(model.user!=null) Expanded( child: TabBarView( physics: BouncingScrollPhysics(), diff --git a/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart b/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart index f56d0f04..e8cb8b24 100644 --- a/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart @@ -1,4 +1,6 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; @@ -8,7 +10,8 @@ class LineChartCurvedBloodPressure extends StatelessWidget { final List timeSeries2; final int indexes; - LineChartCurvedBloodPressure({this.title, this.timeSeries1, this.indexes, this.timeSeries2}); + LineChartCurvedBloodPressure( + {this.title, this.timeSeries1, this.indexes, this.timeSeries2}); List xAxixs = List(); List yAxixs = List(); @@ -34,25 +37,58 @@ class LineChartCurvedBloodPressure extends StatelessWidget { Text( title, style: TextStyle( - color: Colors.black, - fontSize: 15, - letterSpacing: 2), + color: Colors.black, fontSize: 15, letterSpacing: 2), textAlign: TextAlign.center, ), - - SizedBox(height: 10,), + SizedBox( + height: 10, + ), Expanded( child: Padding( - padding: const EdgeInsets.only(right: 18.0, left: 16.0,top: 15), + padding: + const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), child: LineChart( sampleData1(context), swapAnimationDuration: const Duration(milliseconds: 250), ), ), ), - const SizedBox( + SizedBox( height: 10, ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Theme.of(context).primaryColor), + ), + SizedBox(width: 5,), + Texts(TranslationBase.of(context).systolicLng) + ], + ), + SizedBox(width: 15,), + Row( + children: [ + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.grey), + ), + SizedBox(width: 5,), + Texts(TranslationBase.of(context).diastolicLng) + ], + ), + ], + ) ], ), ], @@ -70,13 +106,11 @@ class LineChartCurvedBloodPressure extends StatelessWidget { } } - LineChartData sampleData1(context) { return LineChartData( lineTouchData: LineTouchData( touchTooltipData: LineTouchTooltipData( tooltipBgColor: Colors.white, - ), touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, @@ -90,7 +124,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { color: Colors.black, fontSize: 10, ), - rotateAngle:-65, + rotateAngle: -65, //rotateAngle:-65, margin: 22, getTitles: (value) { @@ -144,7 +178,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), minX: 0, maxX: (timeSeries1.length - 1).toDouble(), - maxY: getMaxY()+0.3, + maxY: getMaxY() + 0.3, minY: getMinY(), lineBarsData: getData(context), ); @@ -161,7 +195,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { if (resultValueDouble > max) max = resultValueDouble; }); - return max.roundToDouble() ; + return max.roundToDouble(); } double getMinY() { @@ -218,9 +252,6 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), ); - return [ - lineChartBarData1, - lineChartBarData2 - ]; + return [lineChartBarData1, lineChartBarData2]; } } diff --git a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart index 908fab8c..416074f2 100644 --- a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart +++ b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart @@ -196,13 +196,13 @@ class VitalSignDetailsScreen extends StatelessWidget { FadePage( page: VitalSignItemDetailsScreen( pageKey: VitalSignDetails.BloodPressure, - pageTitle: TranslationBase.of(context).pulse, + pageTitle: TranslationBase.of(context).bloodPressure, vitalList: mode.vitalSignResModelList, ), ), ), child: VitalSignItem( - des: TranslationBase.of(context).pulse, + des: TranslationBase.of(context).bloodPressure, icon: DQIcons.blood_pressure, lastVal: mode .vitalSignResModelList[ 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 37a81a6d..0c786f2e 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 @@ -39,7 +39,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { 'viewKey': 'WeightKg', }, { - 'name': 'Body Mass ', + 'name': 'BMI ', 'nameAr': 'مؤشر كتلة الجسم', 'title1': 'Date', 'title2': 'BodyMass', diff --git a/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart index 1bbf298c..84a2eb51 100644 --- a/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart @@ -78,8 +78,6 @@ class VitalSingChartBloodPressure extends StatelessWidget { element.toJson()[viewKey2].toDouble(), ), ); - - var asd=""; }, ); } diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 2d8379ee..b3349704 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -190,7 +190,7 @@ class _RateAppointmentDoctorState extends State { child: SecondaryButton( onTap: () async { final form = formKey.currentState; - if (form.validate()) { + if (form.validate() && rating>0 ) { form.save(); Navigator.push( context, @@ -206,7 +206,7 @@ class _RateAppointmentDoctorState extends State { } }, label: TranslationBase.of(context).next, - disabled: model.state == ViewState.BusyLocal, + disabled: model.state == ViewState.BusyLocal|| rating==0, loading: model.state == ViewState.BusyLocal, textColor: Theme.of(context).backgroundColor), ), diff --git a/lib/pages/settings/settings.dart b/lib/pages/settings/settings.dart index cba561b3..0c63b900 100644 --- a/lib/pages/settings/settings.dart +++ b/lib/pages/settings/settings.dart @@ -21,6 +21,10 @@ class _Settings extends State with TickerProviderStateMixin { _tabController = new TabController(length: 2, vsync: this, initialIndex: widget.type); + if(widget.type==1){ + _tabController.animateTo(1); + } + super.initState(); } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 7365a598..ade3128e 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1053,6 +1053,18 @@ class TranslationBase { String get confirmMsgReport => localizedValues['confirm-msg-report'][locale.languageCode]; String get successSendReport => localizedValues['successSendReport'][locale.languageCode]; String get pulseTitle => localizedValues['pulseTitle'][locale.languageCode]; + String get systolicLng => localizedValues['systolic-lng'][locale.languageCode]; + String get diastolicLng => localizedValues['diastolic-lng'][locale.languageCode]; + String get policyHolder => localizedValues['policy-holder'][locale.languageCode]; + String get policyNo => localizedValues['policy-no'][locale.languageCode]; + String get expiryDateTitle => localizedValues['expiry-date'][locale.languageCode]; + String get classTitle => localizedValues['class'][locale.languageCode]; + String get approval => localizedValues['approval'][locale.languageCode]; + String get agree => localizedValues['agree'][locale.languageCode]; + String get disagree => localizedValues['disagree'][locale.languageCode]; + String get requestSent => localizedValues['request-sent'][locale.languageCode]; + String get attachInsuraceImage => localizedValues['attach-insurace-image'][locale.languageCode]; + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/bottom_options/BottomSheet.dart b/lib/widgets/bottom_options/BottomSheet.dart index 494ddff3..7bbadd8c 100644 --- a/lib/widgets/bottom_options/BottomSheet.dart +++ b/lib/widgets/bottom_options/BottomSheet.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'package:image_picker/image_picker.dart'; class ImageOptions { - static showImageOptions(BuildContext context, Function(String) image) { + static showImageOptions(BuildContext context, Function(String,File) image,) { showModalBottomSheet( backgroundColor: Colors.transparent, context: context, @@ -28,7 +28,7 @@ class ImageOptions { final bytes = File(fileName).readAsBytesSync(); String base64Encode = base64.encode(bytes); if (base64Encode != null) { - image(base64Encode); + image(base64Encode,_image); } }, ), @@ -42,7 +42,7 @@ class ImageOptions { final bytes = File(fileName).readAsBytesSync(); String base64Encode = base64.encode(bytes); if (base64Encode != null) { - image(base64Encode); + image(base64Encode,_image); } }, ), diff --git a/lib/widgets/buttons/secondary_button.dart b/lib/widgets/buttons/secondary_button.dart index ccb436fe..262ab43b 100644 --- a/lib/widgets/buttons/secondary_button.dart +++ b/lib/widgets/buttons/secondary_button.dart @@ -236,8 +236,8 @@ class _SecondaryButtonState extends State widget.label, style: TextStyle( color: widget.textColor, - fontSize: widget.small ? 12.0 : 17.0, - fontWeight: FontWeight.w800, + fontSize: widget.small ? 12.0 : 15.0, + // fontWeight: FontWeight.w800, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), ), ) diff --git a/lib/widgets/dialogs/confirm_send_email_dialog.dart b/lib/widgets/dialogs/confirm_send_email_dialog.dart index 96c7a7c8..540824ee 100644 --- a/lib/widgets/dialogs/confirm_send_email_dialog.dart +++ b/lib/widgets/dialogs/confirm_send_email_dialog.dart @@ -1,8 +1,10 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; +import 'package:diplomaticquarterapp/pages/settings/settings.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -89,10 +91,16 @@ class _ConfirmSendEmailDialogState extends State { height: 15.0, ), InkWell( - onTap: () { - Navigator.of(context).pushNamed( - SETTINGS, + onTap: () + { + Navigator.pop(context); + Navigator.push( + context, + FadePage( + page: Settings(type: 1,), + ), ); + }, child: Container( width: double.maxFinite, diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 2c09df47..15b06ce7 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -579,6 +579,7 @@ class _AppDrawerState extends State { this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setString(TOKEN, result.authenticationTokenID); await authenticatedUserObject.getUser(getUser: true); + Provider.of(context, listen: false).setUser( authenticatedUserObject.user); appointmentRateViewModel .getIsLastAppointmentRatedList() .then((value) => {