|
|
|
|
@ -301,11 +301,13 @@ class FamilyCardWidget extends StatelessWidget {
|
|
|
|
|
runSpacing: 4.h,
|
|
|
|
|
children: [
|
|
|
|
|
AppCustomChipWidget(labelText: "${profile.age} Years Old".needTranslation),
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
isActive && appState.getAuthenticatedUser()!.bloodGroup != null
|
|
|
|
|
? AppCustomChipWidget(
|
|
|
|
|
icon: AppAssets.blood_icon,
|
|
|
|
|
labelPadding: EdgeInsetsDirectional.only(start: -6.h, end: 8.h),
|
|
|
|
|
labelText: "Blood: ${appState.getAuthenticatedUser()!.bloodGroup ?? "."}",
|
|
|
|
|
iconColor: AppColors.primaryRedColor),
|
|
|
|
|
labelText: "Blood: ${appState.getAuthenticatedUser()!.bloodGroup ?? ""}",
|
|
|
|
|
iconColor: AppColors.primaryRedColor)
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
Selector<InsuranceViewModel, ({bool isEmpty, int? patientID, bool isLoading, String? cardValidTo})>(
|
|
|
|
|
selector: (context, insuranceVM) => (
|
|
|
|
|
isEmpty: insuranceVM.patientInsuranceList.isEmpty,
|
|
|
|
|
@ -330,7 +332,7 @@ class FamilyCardWidget extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
if (isLoading) {
|
|
|
|
|
icon = AppAssets.cancel_circle_icon;
|
|
|
|
|
labelText = "Insurance";
|
|
|
|
|
labelText = "Insurance".needTranslation;
|
|
|
|
|
iconColor = AppColors.primaryRedColor;
|
|
|
|
|
backgroundColor = AppColors.primaryRedColor;
|
|
|
|
|
} else if (isExpired) {
|
|
|
|
|
@ -356,82 +358,6 @@ class FamilyCardWidget extends StatelessWidget {
|
|
|
|
|
).toShimmer2(isShow: isLoading);
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Consumer<InsuranceViewModel>(builder: (context, insuranceVM, child) {
|
|
|
|
|
// if (insuranceVM.patientInsuranceList.isEmpty) {
|
|
|
|
|
// return const SizedBox();
|
|
|
|
|
// } else if (profile.responseId != insuranceVM.patientInsuranceList.first.patientID) {
|
|
|
|
|
// return SizedBox();
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// final isLoading = insuranceVM.isInsuranceLoading;
|
|
|
|
|
// final isExpired = !isLoading && DateTime.now().isAfter(DateUtil.convertStringToDate(insuranceVM.patientInsuranceList.first.cardValidTo));
|
|
|
|
|
//
|
|
|
|
|
// final String icon;
|
|
|
|
|
// final String labelText;
|
|
|
|
|
// final Color iconColor;
|
|
|
|
|
// final Color backgroundColor;
|
|
|
|
|
//
|
|
|
|
|
// if (isLoading) {
|
|
|
|
|
// icon = AppAssets.cancel_circle_icon;
|
|
|
|
|
// labelText = "Insurance";
|
|
|
|
|
// iconColor = AppColors.primaryRedColor;
|
|
|
|
|
// backgroundColor = AppColors.primaryRedColor;
|
|
|
|
|
// } else if (isExpired) {
|
|
|
|
|
// icon = AppAssets.cancel_circle_icon;
|
|
|
|
|
// labelText = "Insurance Expired".needTranslation;
|
|
|
|
|
// iconColor = AppColors.primaryRedColor;
|
|
|
|
|
// backgroundColor = AppColors.primaryRedColor.withValues(alpha: 0.15);
|
|
|
|
|
// } else {
|
|
|
|
|
// icon = AppAssets.insurance_active_icon;
|
|
|
|
|
// labelText = "Insurance Active".needTranslation;
|
|
|
|
|
// iconColor = AppColors.successColor;
|
|
|
|
|
// backgroundColor = AppColors.successColor.withValues(alpha: 0.15);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// return AppCustomChipWidget(
|
|
|
|
|
// icon: icon,
|
|
|
|
|
// labelText: labelText,
|
|
|
|
|
// iconColor: iconColor,
|
|
|
|
|
// iconSize: 12,
|
|
|
|
|
// backgroundColor: backgroundColor,
|
|
|
|
|
// // padding: EdgeInsets.zero,
|
|
|
|
|
// ).toShimmer2(isShow: isLoading);
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
// Consumer<InsuranceViewModel>(builder: (context, insuranceVM, child) {
|
|
|
|
|
// return insuranceVM.patientInsuranceList. isNotEmpty ? AppCustomChipWidget(
|
|
|
|
|
// icon: insuranceVM.isInsuranceLoading
|
|
|
|
|
// ? AppAssets.cancel_circle_icon
|
|
|
|
|
// : (DateTime.now().isAfter(
|
|
|
|
|
// DateUtil.convertStringToDate(insuranceVM.patientInsuranceList.first.cardValidTo),
|
|
|
|
|
// ))
|
|
|
|
|
// ? AppAssets.cancel_circle_icon
|
|
|
|
|
// : AppAssets.insurance_active_icon,
|
|
|
|
|
// labelText: insuranceVM.isInsuranceLoading
|
|
|
|
|
// ? "Insurance"
|
|
|
|
|
// : (DateTime.now().isAfter(
|
|
|
|
|
// DateUtil.convertStringToDate(insuranceVM.patientInsuranceList.first.cardValidTo),
|
|
|
|
|
// )
|
|
|
|
|
// ? "Insurance Expired".needTranslation
|
|
|
|
|
// : "Insurance Active".needTranslation),
|
|
|
|
|
// iconColor: insuranceVM.isInsuranceLoading
|
|
|
|
|
// ? AppColors.primaryRedColor
|
|
|
|
|
// : (DateTime.now().isAfter(
|
|
|
|
|
// DateUtil.convertStringToDate(insuranceVM.patientInsuranceList.first.cardValidTo),
|
|
|
|
|
// ))
|
|
|
|
|
// ? AppColors.primaryRedColor
|
|
|
|
|
// : AppColors.successColor,
|
|
|
|
|
// iconSize: 14,
|
|
|
|
|
// backgroundColor: insuranceVM.isInsuranceLoading
|
|
|
|
|
// ? AppColors.primaryRedColor
|
|
|
|
|
// : (DateTime.now().isAfter(
|
|
|
|
|
// DateUtil.convertStringToDate(insuranceVM.patientInsuranceList.first.cardValidTo),
|
|
|
|
|
// ))
|
|
|
|
|
// ? AppColors.primaryRedColor.withValues(alpha: 0.15)
|
|
|
|
|
// : AppColors.successColor.withValues(alpha: 0.15),
|
|
|
|
|
// ).toShimmer2(isShow: insuranceVM.isInsuranceLoading) : SizedBox();
|
|
|
|
|
// }),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -439,49 +365,6 @@ class FamilyCardWidget extends StatelessWidget {
|
|
|
|
|
).paddingOnly(top: 16.h, right: 16.h, left: 16.h, bottom: 12.h).expanded,
|
|
|
|
|
1.divider,
|
|
|
|
|
_buildActionButton(appState),
|
|
|
|
|
|
|
|
|
|
// if (appState.getAuthenticatedUser()!.isParentUser ?? false) ...[
|
|
|
|
|
// if (member!.responseId != appState.getAuthenticatedUser()!.patientId) ...[
|
|
|
|
|
// CustomButton(
|
|
|
|
|
// icon: AppAssets.switch_user,
|
|
|
|
|
// text: "Switch Family File".needTranslation,
|
|
|
|
|
// onPressed: () {
|
|
|
|
|
// onFamilySwitchPress(member!);
|
|
|
|
|
// },
|
|
|
|
|
// ).paddingOnly(top: 12, right: 16, left: 16, bottom: 16),
|
|
|
|
|
// ] else
|
|
|
|
|
// ...[
|
|
|
|
|
// CustomButton(
|
|
|
|
|
// icon: AppAssets.add_family,
|
|
|
|
|
// text: "Add a new family member".needTranslation,
|
|
|
|
|
// onPressed: () {
|
|
|
|
|
// onAddFamilyMemberPress();
|
|
|
|
|
// },
|
|
|
|
|
// ).paddingOnly(top: 12, right: 16, left: 16, bottom: 16),
|
|
|
|
|
// ]
|
|
|
|
|
// ] else
|
|
|
|
|
// ...[
|
|
|
|
|
// if (appState.getSuperUserID != null && appState.getSuperUserID == member!.responseId) ...[
|
|
|
|
|
// CustomButton(
|
|
|
|
|
// icon: AppAssets.switch_user,
|
|
|
|
|
// text: "Switch Back To Family File".needTranslation,
|
|
|
|
|
// onPressed: () {
|
|
|
|
|
// onFamilySwitchPress(member!);
|
|
|
|
|
// },
|
|
|
|
|
// ).paddingOnly(top: 12, right: 16, left: 16, bottom: 16),
|
|
|
|
|
// ] else
|
|
|
|
|
// ...[
|
|
|
|
|
// CustomButton(
|
|
|
|
|
// icon: AppAssets.switch_user,
|
|
|
|
|
// text: "Disabled".needTranslation,
|
|
|
|
|
// backgroundColor: Colors.grey.shade200,
|
|
|
|
|
// borderColor: Colors.grey.shade200,
|
|
|
|
|
// textColor: AppColors.greyTextColor,
|
|
|
|
|
// onPressed: () {},
|
|
|
|
|
// iconColor: AppColors.greyTextColor,
|
|
|
|
|
// ).paddingOnly(top: 12, right: 16, left: 16, bottom: 16),
|
|
|
|
|
// ]
|
|
|
|
|
// ]
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|