|
|
|
|
@ -53,26 +53,30 @@ class PatientInsuranceCard extends StatelessWidget {
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.4,
|
|
|
|
|
child: "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}".toText18(isBold: true, textOverflow: TextOverflow.clip, isEnglishOnly: true)),
|
|
|
|
|
LocaleKeys.policyNumber.tr(namedArgs: {'number': insuranceCardDetailsModel.insurancePolicyNo ?? ''}, context: context).toText12(isBold: true, color: AppColors.lightGrayColor),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
"${LocaleKeys.policyNumber.tr(context: context)}${insuranceCardDetailsModel.insurancePolicyNo}".toText12(isBold: true, color: AppColors.lightGrayColor),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
icon: insuranceViewModel.isInsuranceExpired
|
|
|
|
|
icon: isCurrentPatientInsuranceExpired(insuranceCardDetailsModel.cardValidTo!)
|
|
|
|
|
? AppAssets.cancel_circle_icon
|
|
|
|
|
: insuranceViewModel.isInsuranceActive
|
|
|
|
|
? AppAssets.insurance_active_icon
|
|
|
|
|
: AppAssets.alertSquare,
|
|
|
|
|
labelText: insuranceViewModel.isInsuranceExpired
|
|
|
|
|
labelText: isCurrentPatientInsuranceExpired(insuranceCardDetailsModel.cardValidTo!)
|
|
|
|
|
? LocaleKeys.insuranceExpired.tr(context: context)
|
|
|
|
|
: insuranceViewModel.isInsuranceActive
|
|
|
|
|
? LocaleKeys.insuranceActive.tr(context: context)
|
|
|
|
|
: LocaleKeys.insuranceInActive.tr(context: context),
|
|
|
|
|
iconColor: insuranceViewModel.isInsuranceExpired
|
|
|
|
|
iconColor: isCurrentPatientInsuranceExpired(insuranceCardDetailsModel.cardValidTo!)
|
|
|
|
|
? AppColors.primaryRedColor
|
|
|
|
|
: insuranceViewModel.isInsuranceActive
|
|
|
|
|
? AppColors.successColor
|
|
|
|
|
: AppColors.warningColorYellow,
|
|
|
|
|
textColor: insuranceViewModel.isInsuranceExpired
|
|
|
|
|
textColor: isCurrentPatientInsuranceExpired(insuranceCardDetailsModel.cardValidTo!)
|
|
|
|
|
? AppColors.primaryRedColor
|
|
|
|
|
: insuranceViewModel.isInsuranceActive
|
|
|
|
|
? AppColors.successColor
|
|
|
|
|
@ -110,7 +114,7 @@ class PatientInsuranceCard extends StatelessWidget {
|
|
|
|
|
// );
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: insuranceViewModel.isInsuranceExpired
|
|
|
|
|
backgroundColor: isCurrentPatientInsuranceExpired(insuranceCardDetailsModel.cardValidTo!)
|
|
|
|
|
? AppColors.primaryRedColor.withOpacity(0.1)
|
|
|
|
|
: insuranceViewModel.isInsuranceActive
|
|
|
|
|
? AppColors.successColor.withOpacity(0.1)
|
|
|
|
|
@ -130,7 +134,23 @@ class PatientInsuranceCard extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 12.h),
|
|
|
|
|
insuranceCardDetailsModel.groupName!.toText12(isBold: true),
|
|
|
|
|
insuranceCardDetailsModel.companyName!.toText12(isBold: true),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
insuranceCardDetailsModel.companyName!.toText12(isBold: true),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 6.h,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 6.h, vertical: 4.h),
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: AppColors.infoColor,
|
|
|
|
|
borderRadius: 50.r,
|
|
|
|
|
),
|
|
|
|
|
child: (insuranceCardDetailsModel.subCategoryDesc!.length > 5 ? insuranceCardDetailsModel.subCategoryDesc!.substring(0, 12) : insuranceCardDetailsModel.subCategoryDesc!)
|
|
|
|
|
.toText8(isBold: true, color: AppColors.whiteColor),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
Wrap(
|
|
|
|
|
direction: Axis.horizontal,
|
|
|
|
|
@ -150,9 +170,10 @@ class PatientInsuranceCard extends StatelessWidget {
|
|
|
|
|
isInsuranceExpired
|
|
|
|
|
? CustomButton(
|
|
|
|
|
icon: AppAssets.update_insurance_card_icon,
|
|
|
|
|
iconColor: AppColors.successColor,
|
|
|
|
|
iconColor: AppColors.warningColorYellow,
|
|
|
|
|
iconSize: 15.h,
|
|
|
|
|
text: "${LocaleKeys.updateInsurance.tr(context: context)} ${LocaleKeys.updateInsuranceSubtitle.tr(context: context)}",
|
|
|
|
|
// text: "${LocaleKeys.updateInsurance.tr(context: context)} ${LocaleKeys.updateInsuranceSubtitle.tr(context: context)}",
|
|
|
|
|
text: LocaleKeys.verifyInsurance.tr(context: context),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
insuranceViewModel.setIsInsuranceUpdateDetailsLoading(true);
|
|
|
|
|
insuranceViewModel.getPatientInsuranceDetailsForUpdate(
|
|
|
|
|
@ -165,9 +186,9 @@ class PatientInsuranceCard extends StatelessWidget {
|
|
|
|
|
isCloseButtonVisible: false,
|
|
|
|
|
isFullScreen: false);
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: AppColors.bgGreenColor.withOpacity(0.20),
|
|
|
|
|
borderColor: AppColors.bgGreenColor.withOpacity(0.0),
|
|
|
|
|
textColor: AppColors.bgGreenColor,
|
|
|
|
|
backgroundColor: AppColors.warningColorYellow.withOpacity(0.20),
|
|
|
|
|
borderColor: AppColors.warningColorYellow.withOpacity(0.0),
|
|
|
|
|
textColor: AppColors.warningColorYellow,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
borderRadius: 12,
|
|
|
|
|
@ -180,4 +201,10 @@ class PatientInsuranceCard extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
).paddingSymmetrical(0.h, 0.h);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool isCurrentPatientInsuranceExpired(String cardValidTo) {
|
|
|
|
|
return DateTime.now().isAfter(
|
|
|
|
|
DateUtil.convertStringToDate(cardValidTo),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|