diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index 29ca7c4..5a38342 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -747,7 +747,7 @@ class ApiConsts { baseUrl = "https://uat.hmgwebservices.com/"; break; case AppEnvironmentTypeEnum.preProd: - baseUrl = "https://uat.hmgwebservices.com/"; + baseUrl = "https://webservices.hmg.com/"; break; case AppEnvironmentTypeEnum.qa: baseUrl = "https://uat.hmgwebservices.com/"; diff --git a/lib/features/insurance/insurance_repo.dart b/lib/features/insurance/insurance_repo.dart index cb06724..536556f 100644 --- a/lib/features/insurance/insurance_repo.dart +++ b/lib/features/insurance/insurance_repo.dart @@ -3,11 +3,17 @@ import 'package:hmg_patient_app_new/core/api/api_client.dart'; import 'package:hmg_patient_app_new/core/api_consts.dart'; import 'package:hmg_patient_app_new/core/common_models/generic_api_model.dart'; import 'package:hmg_patient_app_new/core/exceptions/api_failure.dart'; +import 'package:hmg_patient_app_new/features/insurance/models/resp_models/patient_insurance_card_history.dart'; import 'package:hmg_patient_app_new/features/insurance/models/resp_models/patient_insurance_details_response_model.dart'; +import 'package:hmg_patient_app_new/features/insurance/models/resp_models/patient_insurance_update_response_model.dart'; import 'package:hmg_patient_app_new/services/logger_service.dart'; abstract class InsuranceRepo { Future>>> getPatientInsuranceDetails({required String patientId}); + + Future>>> getPatientInsuranceCardHistory({required String patientId}); + + Future>> getPatientInsuranceDetailsForUpdate({required String patientId, required String identificationNo}); } class InsuranceRepoImp implements InsuranceRepo { @@ -74,4 +80,123 @@ class InsuranceRepoImp implements InsuranceRepo { throw UnimplementedError(); } + + @override + Future>>> getPatientInsuranceCardHistory({required String patientId}) async { + final mapDevice = { + "isDentalAllowedBackend": false, + "VersionID": 50.0, + "Channel": 3, + "LanguageID": 2, + "IPAdress": "10.20.10.20", + "generalid": "Cs2020@2016\$2958", + "Latitude": 0.0, + "Longitude": 0.0, + "DeviceTypeID": 1, + "PatientType": 1, + "PatientTypeID": 1, + "TokenID": "@dm!n", + "PatientID": "3628599", + "PatientOutSA": "0", + "SessionID": "03478TYC02N80874CTYN04883475!?" + }; + + try { + GenericApiModel>? apiResponse; + Failure? failure; + await apiClient.post( + GET_PAtIENTS_INSURANCE_UPDATED, + body: mapDevice, + onFailure: (error, statusCode, {messageStatus, failureType}) { + failure = failureType; + }, + onSuccess: (response, statusCode, {messageStatus, errorMessage}) { + try { + final list = response['List_PatientInsuranceCardHistory']; + if (list == null || list.isEmpty) { + throw Exception("insurance list is empty"); + } + + final insuranceCardsList = list.map((item) => PatientInsuranceCardHistoryResponseModel.fromJson(item as Map)).toList().cast(); + + apiResponse = GenericApiModel>( + messageStatus: messageStatus, + statusCode: statusCode, + errorMessage: null, + data: insuranceCardsList, + ); + } catch (e) { + failure = DataParsingFailure(e.toString()); + } + }, + ); + if (failure != null) return Left(failure!); + if (apiResponse == null) return Left(ServerFailure("Unknown error")); + return Right(apiResponse!); + } catch (e) { + return Left(UnknownFailure(e.toString())); + } + } + + @override + Future>> getPatientInsuranceDetailsForUpdate({required String patientId, required String identificationNo}) async { + final mapDevice = { + "SetupID": "010266", + "ProjectID": 15, + "PatientIdentificationID": "2464169354", + "isDentalAllowedBackend": false, + "PatientID": "3628599", + "IsFamily": false, + "ParentID": 0, + "VersionID": 18.8, + "Channel": 3, + "LanguageID": 2, + "IPAdress": "10.20.10.20", + "generalid": "Cs2020@2016\$2958", + "Latitude": 0.0, + "Longitude": 0.0, + "DeviceTypeID": 2, + "PatientType": 1, + "PatientTypeID": 1, + "TokenID": "@dm!n", + "PatientOutSA": 0, + "SessionID": "eyy7u090a9dfadsghfpsadiuhf234" + }; + + try { + GenericApiModel? apiResponse; + Failure? failure; + await apiClient.post( + GET_PATIENT_INSURANCE_DETAILS, + body: mapDevice, + onFailure: (error, statusCode, {messageStatus, failureType}) { + failure = failureType; + }, + onSuccess: (response, statusCode, {messageStatus, errorMessage}) { + try { + final list = response['List_PatientInsuranceDetails']; + if (list == null || list.isEmpty) { + throw Exception("insurance list is empty"); + } + + final insuranceCardsList = PatientInsuranceUpdateResponseModel.fromJson(list[0]); + + apiResponse = GenericApiModel( + messageStatus: messageStatus, + statusCode: statusCode, + errorMessage: null, + data: insuranceCardsList, + ); + } catch (e) { + failure = DataParsingFailure(e.toString()); + } + }, + ); + if (failure != null) return Left(failure!); + if (apiResponse == null) return Left(ServerFailure("Unknown error")); + return Right(apiResponse!); + } catch (e) { + return Left(UnknownFailure(e.toString())); + } + } } diff --git a/lib/features/insurance/insurance_view_model.dart b/lib/features/insurance/insurance_view_model.dart index fac09da..169d967 100644 --- a/lib/features/insurance/insurance_view_model.dart +++ b/lib/features/insurance/insurance_view_model.dart @@ -1,24 +1,34 @@ import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/features/insurance/insurance_repo.dart'; +import 'package:hmg_patient_app_new/features/insurance/models/resp_models/patient_insurance_card_history.dart'; import 'package:hmg_patient_app_new/features/insurance/models/resp_models/patient_insurance_details_response_model.dart'; +import 'package:hmg_patient_app_new/features/insurance/models/resp_models/patient_insurance_update_response_model.dart'; import 'package:hmg_patient_app_new/features/lab/lab_repo.dart'; import 'package:hmg_patient_app_new/services/error_handler_service.dart'; class InsuranceViewModel extends ChangeNotifier { bool isInsuranceLoading = false; bool isInsuranceHistoryLoading = false; + bool isInsuranceDetailsLoading = false; + bool isInsuranceUpdateDetailsLoading = false; InsuranceRepo insuranceRepo; ErrorHandlerService errorHandlerService; List patientInsuranceList = []; + List patientInsuranceCardHistoryList = []; + + PatientInsuranceUpdateResponseModel? patientInsuranceUpdateResponseModel; InsuranceViewModel({required this.insuranceRepo, required this.errorHandlerService}); initInsuranceProvider() { patientInsuranceList.clear(); + patientInsuranceCardHistoryList.clear(); isInsuranceLoading = true; isInsuranceHistoryLoading = true; + isInsuranceDetailsLoading = true; + isInsuranceUpdateDetailsLoading = true; getPatientInsuranceDetails(); notifyListeners(); } @@ -28,6 +38,16 @@ class InsuranceViewModel extends ChangeNotifier { notifyListeners(); } + setIsInsuranceDetailsLoading(bool val) { + isInsuranceDetailsLoading = val; + notifyListeners(); + } + + setIsInsuranceUpdateDetailsLoading(bool val) { + isInsuranceUpdateDetailsLoading = val; + notifyListeners(); + } + Future getPatientInsuranceDetails({Function(dynamic)? onSuccess, Function(String)? onError}) async { final result = await insuranceRepo.getPatientInsuranceDetails(patientId: "1231755"); @@ -47,4 +67,45 @@ class InsuranceViewModel extends ChangeNotifier { }, ); } + + Future getPatientInsuranceCardHistory({Function(dynamic)? onSuccess, Function(String)? onError}) async { + final result = await insuranceRepo.getPatientInsuranceCardHistory(patientId: "1231755"); + + result.fold( + (failure) async => await errorHandlerService.handleError(failure: failure), + (apiResponse) { + if (apiResponse.messageStatus == 2) { + // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); + } else if (apiResponse.messageStatus == 1) { + patientInsuranceCardHistoryList = apiResponse.data!; + patientInsuranceCardHistoryList = patientInsuranceCardHistoryList.take(3).toList(); + isInsuranceHistoryLoading = false; + notifyListeners(); + if (onSuccess != null) { + onSuccess(apiResponse); + } + } + }, + ); + } + + Future getPatientInsuranceDetailsForUpdate({Function(dynamic)? onSuccess, Function(String)? onError}) async { + final result = await insuranceRepo.getPatientInsuranceDetailsForUpdate(patientId: "1231755", identificationNo: ""); + + result.fold( + (failure) async => await errorHandlerService.handleError(failure: failure), + (apiResponse) { + if (apiResponse.messageStatus == 2) { + // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); + } else if (apiResponse.messageStatus == 1) { + patientInsuranceUpdateResponseModel = apiResponse.data!; + isInsuranceUpdateDetailsLoading = false; + notifyListeners(); + if (onSuccess != null) { + onSuccess(apiResponse); + } + } + }, + ); + } } diff --git a/lib/features/insurance/models/resp_models/patient_insurance_card_history.dart b/lib/features/insurance/models/resp_models/patient_insurance_card_history.dart new file mode 100644 index 0000000..17436f0 --- /dev/null +++ b/lib/features/insurance/models/resp_models/patient_insurance_card_history.dart @@ -0,0 +1,73 @@ +class PatientInsuranceCardHistoryResponseModel { + int? createdBy; + String? createdOn; + int? editedBy; + String? editedOn; + String? insuranceCardImage; + String? mobileNumber; + int? patientID; + String? patientIdentificationNo; + String? patientInsuranceCardUpdateInfoID; + int? patientType; + int? projectID; + String? rejectionRemarks; + int? setupID; + int? status; + String? statusDescription; + + PatientInsuranceCardHistoryResponseModel( + {this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.insuranceCardImage, + this.mobileNumber, + this.patientID, + this.patientIdentificationNo, + this.patientInsuranceCardUpdateInfoID, + this.patientType, + this.projectID, + this.rejectionRemarks, + this.setupID, + this.status, + this.statusDescription}); + + PatientInsuranceCardHistoryResponseModel.fromJson(Map json) { + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + insuranceCardImage = json['InsuranceCardImage']; + mobileNumber = json['MobileNumber']; + patientID = json['PatientID']; + patientIdentificationNo = json['PatientIdentificationNo']; + patientInsuranceCardUpdateInfoID = json['PatientInsuranceCardUpdateInfoID']; + patientType = json['PatientType']; + projectID = json['ProjectID']; + rejectionRemarks = json['RejectionRemarks']; + setupID = json['SetupID']; + status = json['Status']; + statusDescription = json['StatusDescription']; + } + + Map toJson() { + final Map data = new Map(); + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['InsuranceCardImage'] = this.insuranceCardImage; + data['MobileNumber'] = this.mobileNumber; + data['PatientID'] = this.patientID; + data['PatientIdentificationNo'] = this.patientIdentificationNo; + data['PatientInsuranceCardUpdateInfoID'] = + this.patientInsuranceCardUpdateInfoID; + data['PatientType'] = this.patientType; + data['ProjectID'] = this.projectID; + data['RejectionRemarks'] = this.rejectionRemarks; + data['SetupID'] = this.setupID; + data['Status'] = this.status; + data['StatusDescription'] = this.statusDescription; + return data; + } +} diff --git a/lib/features/insurance/models/resp_models/patient_insurance_update_response_model.dart b/lib/features/insurance/models/resp_models/patient_insurance_update_response_model.dart new file mode 100644 index 0000000..3903a99 --- /dev/null +++ b/lib/features/insurance/models/resp_models/patient_insurance_update_response_model.dart @@ -0,0 +1,88 @@ +class PatientInsuranceUpdateResponseModel { + dynamic approvalLimit; + int? companyGroupID; + String? companyName; + String? companyRemarks; + String? dOB; + dynamic deductible; + String? effectiveFrom; + String? effectiveTo; + String? eligabilityFailureReason; + bool? isMemberEligible; + String? memberID; + String? memberName; + String? memberStatus; + dynamic message; + String? nationalId; + String? policyNumber; + String? responseMessage; + dynamic room; + String? subCategory; + + PatientInsuranceUpdateResponseModel( + {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}); + + PatientInsuranceUpdateResponseModel.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/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index a96b068..fdeb407 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -161,6 +161,7 @@ class _LandingPageState extends State { textColor: LandingPageData.getLoggedInServiceCardsList[index].textColor, backgroundColor: LandingPageData.getLoggedInServiceCardsList[index].backgroundColor, isBold: LandingPageData.getLoggedInServiceCardsList[index].isBold, + serviceName: LandingPageData.getLoggedInServiceCardsList[index].serviceName, ), ), ), diff --git a/lib/presentation/insurance/insurance_home_page.dart b/lib/presentation/insurance/insurance_home_page.dart index 9f9271a..131c454 100644 --- a/lib/presentation/insurance/insurance_home_page.dart +++ b/lib/presentation/insurance/insurance_home_page.dart @@ -62,8 +62,9 @@ class _InsuranceHomePageState extends State { text: LocaleKeys.history.tr(context: context), onPressed: () { insuranceVM.setIsInsuranceHistoryLoading(true); + insuranceVM.getPatientInsuranceCardHistory(); showCommonBottomSheet(context, - child: InsuranceHistory(), callBackFunc: () {}, title: "", height: ResponsiveExtension.screenHeight * 0.5, isCloseButtonVisible: false, isFullScreen: false); + child: InsuranceHistory(), callBackFunc: () {}, title: "", height: ResponsiveExtension.screenHeight * 0.65, isCloseButtonVisible: false, isFullScreen: false); }, backgroundColor: AppColors.primaryRedColor.withOpacity(0.1), borderColor: AppColors.primaryRedColor.withOpacity(0.0), diff --git a/lib/presentation/insurance/widgets/insurance_history.dart b/lib/presentation/insurance/widgets/insurance_history.dart index 0708c7c..397cb63 100644 --- a/lib/presentation/insurance/widgets/insurance_history.dart +++ b/lib/presentation/insurance/widgets/insurance_history.dart @@ -1,5 +1,6 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart'; @@ -7,6 +8,8 @@ import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/insurance/insurance_view_model.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; +import 'package:hmg_patient_app_new/theme/colors.dart'; +import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/shimmer/movies_shimmer_widget.dart'; import 'package:provider/provider.dart'; @@ -31,7 +34,100 @@ class InsuranceHistory extends StatelessWidget { }), ], ).paddingSymmetrical(24.h, 24.h), - insuranceVM.isInsuranceHistoryLoading ? const MoviesShimmerWidget().paddingSymmetrical(24.h, 24.h) : Container() + insuranceVM.isInsuranceHistoryLoading + ? const MoviesShimmerWidget().paddingSymmetrical(24.h, 24.h) + : ListView.separated( + itemCount: insuranceVM.patientInsuranceCardHistoryList.length, + shrinkWrap: true, + padding: const EdgeInsets.only(left: 0, right: 8), + itemBuilder: (context, index) { + return AnimationConfiguration.staggeredList( + position: index, + duration: const Duration(milliseconds: 1000), + child: SlideAnimation( + verticalOffset: 100.0, + child: FadeInAnimation( + child: Container( + // height: 120.h, + decoration: RoundedRectangleBorder().toSmoothCornerDecoration( + color: AppColors.whiteColor, + borderRadius: 24, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + CustomButton( + text: insuranceVM.patientInsuranceCardHistoryList[index].statusDescription!, + onPressed: () {}, + backgroundColor: AppColors.primaryRedColor.withOpacity(0.1), + borderColor: AppColors.primaryRedColor.withOpacity(0.0), + textColor: AppColors.primaryRedColor, + fontSize: 10, + fontWeight: FontWeight.w500, + borderRadius: 8, + padding: EdgeInsets.fromLTRB(10, 0, 10, 0), + height: 30.h, + ), + ], + ), + SizedBox(height: 8.h), + "Haroon Amjad".toText16(weight: FontWeight.w600), + SizedBox(height: 8.h), + Row( + children: [ + Wrap( + direction: Axis.horizontal, + spacing: 4.h, + runSpacing: 4.h, + children: [ + Row( + children: [ + CustomButton( + text: "File No.: 3628599", + onPressed: () {}, + backgroundColor: AppColors.greyColor, + borderColor: AppColors.greyColor, + textColor: AppColors.blackColor, + fontSize: 10, + fontWeight: FontWeight.w500, + borderRadius: 12, + padding: EdgeInsets.fromLTRB(10, 0, 10, 0), + height: 30.h, + ), + ], + ), + Row( + children: [ + CustomButton( + text: insuranceVM.patientInsuranceCardHistoryList[index].createdOn!, + // text: "test", + onPressed: () {}, + backgroundColor: AppColors.greyColor, + borderColor: AppColors.greyColor, + textColor: AppColors.blackColor, + fontSize: 10, + fontWeight: FontWeight.w500, + borderRadius: 12, + padding: EdgeInsets.fromLTRB(10, 0, 10, 0), + height: 30.h, + ), + ], + ), + ], + ), + ], + ), + ], + ).paddingSymmetrical(16.h, 16.h), + ).paddingSymmetrical(24.h, 0.h), + ), + ), + ); + }, + separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h), + ), ], ); }); diff --git a/lib/presentation/insurance/widgets/insurance_update_details_card.dart b/lib/presentation/insurance/widgets/insurance_update_details_card.dart new file mode 100644 index 0000000..51afdc4 --- /dev/null +++ b/lib/presentation/insurance/widgets/insurance_update_details_card.dart @@ -0,0 +1,139 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:hmg_patient_app_new/core/app_assets.dart'; +import 'package:hmg_patient_app_new/core/utils/date_util.dart'; +import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; +import 'package:hmg_patient_app_new/core/utils/utils.dart'; +import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; +import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; +import 'package:hmg_patient_app_new/features/insurance/insurance_view_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; +import 'package:hmg_patient_app_new/theme/colors.dart'; +import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; +import 'package:hmg_patient_app_new/widgets/shimmer/movies_shimmer_widget.dart'; +import 'package:provider/provider.dart'; + +class PatientInsuranceCardUpdateCard extends StatelessWidget { + PatientInsuranceCardUpdateCard({super.key}); + + late InsuranceViewModel insuranceViewModel; + + @override + Widget build(BuildContext context) { + insuranceViewModel = Provider.of(context); + return Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + LocaleKeys.insuranceCards.tr(context: context).toText24(isBold: true), + Utils.buildSvgWithAssets(icon: AppAssets.close_bottom_sheet_icon).onPress(() { + Navigator.of(context).pop(); + }), + ], + ).paddingSymmetrical(24.h, 24.h), + insuranceViewModel.isInsuranceUpdateDetailsLoading + ? const MoviesShimmerWidget().paddingSymmetrical(24.h, 24.h) + : Container( + // height: 120.h, + decoration: RoundedRectangleBorder().toSmoothCornerDecoration( + color: AppColors.whiteColor, + borderRadius: 24, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Haroon Amjad".toText16(weight: FontWeight.w600), + "Policy: ${insuranceViewModel.patientInsuranceUpdateResponseModel!.policyNumber}".toText12(isBold: true, color: AppColors.lightGrayColor), + SizedBox(height: 8.h), + Row( + children: [ + insuranceViewModel.patientInsuranceUpdateResponseModel!.companyName!.toText12(isBold: true), + SizedBox( + width: 6.h, + ), + Container( + padding: EdgeInsets.symmetric(horizontal: 6.h, vertical: 3.h), + decoration: RoundedRectangleBorder().toSmoothCornerDecoration( + color: AppColors.infoColor, + borderRadius: 50, + ), + child: insuranceViewModel.patientInsuranceUpdateResponseModel!.subCategory!.toText8(isBold: true, color: AppColors.whiteColor), + ), + ], + ), + SizedBox(height: 8.h), + Row( + children: [ + Wrap( + direction: Axis.horizontal, + spacing: 4.h, + runSpacing: 4.h, + children: [ + Row( + children: [ + CustomButton( + icon: AppAssets.doctor_calendar_icon, + iconColor: AppColors.blackColor, + iconSize: 13.h, + text: "${LocaleKeys.expiryOn.tr(context: context)} ${insuranceViewModel.patientInsuranceUpdateResponseModel!.effectiveTo}", + onPressed: () {}, + backgroundColor: AppColors.greyColor, + borderColor: AppColors.greyColor, + textColor: AppColors.blackColor, + fontSize: 10, + fontWeight: FontWeight.w500, + borderRadius: 12, + padding: EdgeInsets.fromLTRB(10, 0, 10, 0), + height: 30.h, + ), + ], + ), + Row( + children: [ + CustomButton( + text: "Member ID: ${insuranceViewModel.patientInsuranceUpdateResponseModel!.memberID!}", + onPressed: () {}, + backgroundColor: AppColors.greyColor, + borderColor: AppColors.greyColor, + textColor: AppColors.blackColor, + fontSize: 10, + fontWeight: FontWeight.w500, + borderRadius: 12, + padding: EdgeInsets.fromLTRB(10, 0, 10, 0), + height: 30.h, + ), + ], + ), + ], + ), + ], + ), + ], + ).paddingSymmetrical(16.h, 16.h), + ).paddingSymmetrical(24.h, 0.h), + SizedBox( + height: 24.h, + ), + CustomButton( + icon: AppAssets.insurance_active_icon, + iconColor: AppColors.whiteColor, + iconSize: 20.h, + text: "Update Insurance", + onPressed: () {}, + backgroundColor: AppColors.successColor, + borderColor: AppColors.successColor.withOpacity(0.01), + textColor: AppColors.whiteColor, + fontSize: 16, + fontWeight: FontWeight.w500, + borderRadius: 12, + padding: EdgeInsets.fromLTRB(10, 0, 10, 0), + height: 56.h, + ).paddingSymmetrical(24.h, 0.h), + SizedBox( + height: 24.h, + ), + ], + ); + } +} diff --git a/lib/presentation/insurance/widgets/patient_insurance_card.dart b/lib/presentation/insurance/widgets/patient_insurance_card.dart index 2701233..1edef84 100644 --- a/lib/presentation/insurance/widgets/patient_insurance_card.dart +++ b/lib/presentation/insurance/widgets/patient_insurance_card.dart @@ -8,8 +8,10 @@ import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/insurance/insurance_view_model.dart'; import 'package:hmg_patient_app_new/features/insurance/models/resp_models/patient_insurance_details_response_model.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; +import 'package:hmg_patient_app_new/presentation/insurance/widgets/insurance_update_details_card.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; +import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:provider/provider.dart'; class PatientInsuranceCard extends StatelessWidget { @@ -114,7 +116,12 @@ class PatientInsuranceCard extends StatelessWidget { iconColor: AppColors.successColor, iconSize: 15.h, text: "${LocaleKeys.updateInsurance.tr(context: context)} ${LocaleKeys.updateInsuranceSubtitle.tr(context: context)}", - onPressed: () {}, + onPressed: () { + insuranceViewModel.setIsInsuranceUpdateDetailsLoading(true); + insuranceViewModel.getPatientInsuranceDetailsForUpdate(); + showCommonBottomSheet(context, + child: PatientInsuranceCardUpdateCard(), callBackFunc: () {}, title: "", height: ResponsiveExtension.screenHeight * 0.42, isCloseButtonVisible: false, isFullScreen: false); + }, backgroundColor: AppColors.bgGreenColor.withOpacity(0.20), borderColor: AppColors.bgGreenColor.withOpacity(0.0), textColor: AppColors.bgGreenColor,