pull/199/head
haroon amjad 2 days ago
parent 0ed6103b15
commit 4a3d66f01a

@ -1587,5 +1587,7 @@
"ratings": "التقييمات",
"hmgPharmacyText": "صيدلية الحبيب، المتجر الصيدلاني الإلكتروني المتكامل الذي تقدمه لكم مجموعة خدمات الدكتور سليمان الحبيب الطبية.",
"insuranceRequestSubmittedSuccessfully": "تم إرسال طلب تحديث بيانات التأمين بنجاح. سيتم إعلامك بمجرد الانتهاء.",
"updatingEmailAddress": "جارٍ تحديث عنوان البريد الإلكتروني، يرجى الانتظار..."
"updatingEmailAddress": "جارٍ تحديث عنوان البريد الإلكتروني، يرجى الانتظار...",
"verifyInsurance": "التحقق من التأمين",
"tests": "تحليل"
}

@ -1581,5 +1581,7 @@
"ratings": "Ratings",
"hmgPharmacyText": "Al Habib Pharmacy, the complete online Pharmaceutical store brought to you by Dr. Sulaiman Al Habib Medical Services Group.",
"insuranceRequestSubmittedSuccessfully": "Your insurance update request has been successfully submitted. You will be notified once completed.",
"updatingEmailAddress": "Updating email address, Please wait..."
"updatingEmailAddress": "Updating email address, Please wait...",
"verifyInsurance": "Verify Insurance",
"tests": "tests"
}

@ -200,7 +200,7 @@ class ApiClientImp implements ApiClient {
}
// body['TokenID'] = "@dm!n";
// body['PatientID'] = 4774402;
// body['PatientID'] = 1231755;
// body['PatientTypeID'] = 1;
// body['PatientOutSA'] = 0;
// body['SessionID'] = "45786230487560q";

@ -1,7 +1,9 @@
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/enums.dart';
import 'package:hmg_patient_app_new/extensions/int_extensions.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/features/profile_settings/profile_settings_view_model.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:shimmer/shimmer.dart';
import 'package:sizer/sizer.dart';
@ -166,7 +168,7 @@ extension SmoothContainerExtension on ShapeBorder {
? [
BoxShadow(
// color: hasDenseShadow ? const Color(0xff000000).withOpacity(.06) : const Color(0xff000000).withOpacity(.1),
color: const Color(0xffE1E1E1).withOpacity(1.0),
color: getIt.get<ProfileSettingsViewModel>().isDarkMode ? Color(0xff3a3a3a).withOpacity(1.0) : Color(0xffE1E1E1).withOpacity(1.0),
blurRadius: 0,
spreadRadius: 0,
offset: const Offset(1, 0),

@ -47,7 +47,7 @@ class AskDoctorRepoImp implements AskDoctorRepo {
try {
final list = response['PatientDoctorAppointmentResultList'];
final clinicsList = list.map((item) => AskDoctorAppointmentHistoryList.fromJson(item as Map<String, dynamic>)).toList().cast<AskDoctorAppointmentHistoryList>();
final clinicsList = list != null ? list.map((item) => AskDoctorAppointmentHistoryList.fromJson(item as Map<String, dynamic>)).toList().cast<AskDoctorAppointmentHistoryList>() : [];
apiResponse = GenericApiModel<List<AskDoctorAppointmentHistoryList>>(
messageStatus: messageStatus,

@ -143,7 +143,7 @@ class AskDoctorAppointmentHistoryList {
noOfPatientsRate = json['NoOfPatientsRate'];
projectName = json['ProjectName'];
qR = json['QR'];
speciality = json['Speciality'].cast<String>();
// speciality = json['Speciality'].cast<String>();
}
Map<String, dynamic> toJson() {

@ -13,6 +13,7 @@ class InsuranceViewModel extends ChangeNotifier {
bool isInsuranceHistoryLoading = false;
bool isInsuranceDetailsLoading = false;
bool isInsuranceUpdateDetailsLoading = false;
bool isInsuranceExpiryBannerShown = false;
bool isInsuranceDataToBeLoaded = true;
bool isInsuranceApprovalsLoading = false;
@ -49,6 +50,11 @@ class InsuranceViewModel extends ChangeNotifier {
notifyListeners();
}
setIsInsuranceExpiryBannerShown(bool isInsuranceExpiryBannerShown) {
this.isInsuranceExpiryBannerShown = isInsuranceExpiryBannerShown;
notifyListeners();
}
setIsInsuranceHistoryLoading(bool val) {
isInsuranceHistoryLoading = val;
notifyListeners();
@ -91,6 +97,7 @@ class InsuranceViewModel extends ChangeNotifier {
isInsuranceDataToBeLoaded = true;
isInsuranceExpired = false;
isInsuranceActive = false;
isInsuranceExpiryBannerShown = false;
notifyListeners();
},
(apiResponse) {
@ -111,6 +118,8 @@ class InsuranceViewModel extends ChangeNotifier {
debugPrint("InsuranceViewModel: Insurance card expired: $isInsuranceExpired");
}
isInsuranceExpiryBannerShown = isInsuranceExpired;
isInsuranceActive = patientInsuranceList.first.isActive ?? false;
// isInsuranceActive = true;
@ -148,6 +157,9 @@ class InsuranceViewModel extends ChangeNotifier {
}
Future<void> getPatientInsuranceDetailsForUpdate(String patientID, String identificationNo, {Function(dynamic)? onSuccess, Function(String)? onError}) async {
patientInsuranceUpdateResponseModel = null;
notifyListeners();
final result = await insuranceRepo.getPatientInsuranceDetailsForUpdate(patientId: patientID, identificationNo: identificationNo);
result.fold(

@ -149,21 +149,26 @@ class LabViewModel extends ChangeNotifier {
isLabOrdersLoading = false;
isLabResultsLoading = false;
// --- Build groups by clinic and by hospital (projectName) ---
final clinicMap = <String, List<PatientLabOrdersResponseModel>>{};
final hospitalMap = <String, List<PatientLabOrdersResponseModel>>{};
for (var order in patientLabOrders) {
final clinicKey = (order.clinicDescription ?? 'Unknown').trim();
clinicMap.putIfAbsent(clinicKey, () => []).add(order);
final hospitalKey = (order.projectName ?? order.projectID ?? 'Unknown').toString().trim();
hospitalMap.putIfAbsent(hospitalKey, () => []).add(order);
order.testDetails!.sort((a, b) => a.description!.compareTo(b.description!));
}
patientLabOrdersByClinic = clinicMap.values.toList();
patientLabOrdersByHospital = hospitalMap.values.toList();
patientLabOrdersViewList = isSortByClinic ? patientLabOrdersByClinic : patientLabOrdersByHospital;
// --- Build groups by clinic and by hospital (projectName) ---
// final clinicMap = <String, List<PatientLabOrdersResponseModel>>{};
// final hospitalMap = <String, List<PatientLabOrdersResponseModel>>{};
//
// for (var order in patientLabOrders) {
// final clinicKey = (order.clinicDescription ?? 'Unknown').trim();
// clinicMap.putIfAbsent(clinicKey, () => []).add(order);
//
// final hospitalKey = (order.projectName ?? order.projectID ?? 'Unknown').toString().trim();
// hospitalMap.putIfAbsent(hospitalKey, () => []).add(order);
// }
// patientLabOrdersByClinic = clinicMap.values.toList();
// patientLabOrdersByHospital = hospitalMap.values.toList();
// patientLabOrdersViewList = isSortByClinic ? patientLabOrdersByClinic : patientLabOrdersByHospital;
// patientLabOrdersViewList = patientLabOrdersByClinic;
filterSuggestions();
getUniqueTestDescription();

@ -1582,5 +1582,7 @@ abstract class LocaleKeys {
static const hmgPharmacyText = 'hmgPharmacyText';
static const insuranceRequestSubmittedSuccessfully = 'insuranceRequestSubmittedSuccessfully';
static const updatingEmailAddress = 'updatingEmailAddress';
static const verifyInsurance = 'verifyInsurance';
static const tests = 'tests';
}

@ -14,6 +14,7 @@ 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/ask_doctor/ask_doctor_view_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/doctors_list_response_model.dart';
import 'package:hmg_patient_app_new/features/contact_us/contact_us_view_model.dart';
@ -31,6 +32,8 @@ import 'package:hmg_patient_app_new/presentation/appointments/appointment_paymen
import 'package:hmg_patient_app_new/presentation/appointments/widgets/appointment_checkin_bottom_sheet.dart';
import 'package:hmg_patient_app_new/presentation/appointments/widgets/appointment_doctor_card.dart';
import 'package:hmg_patient_app_new/presentation/appointments/widgets/ask_doctor_request_type_select.dart';
import 'package:hmg_patient_app_new/presentation/ask_doctor/ask_doctor_page.dart';
import 'package:hmg_patient_app_new/presentation/ask_doctor/doctor_response_page.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/appointment_calendar.dart';
import 'package:hmg_patient_app_new/presentation/contact_us/feedback_page.dart';
import 'package:hmg_patient_app_new/presentation/prescriptions/prescription_detail_page.dart';
@ -556,6 +559,22 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
// ),
// );
}),
MedicalFileCard(
label: LocaleKeys.doctorResponses.tr(context: context),
textColor: AppColors.blackColor,
backgroundColor: AppColors.whiteColor,
svgIcon: AppAssets.ask_doctor_medical_file_icon,
isLargeText: true,
iconSize: 36.w,
).onPress(() {
getIt.get<AskDoctorViewModel>().initAskDoctorViewModel();
getIt.get<AskDoctorViewModel>().getDoctorResponses();
Navigator.of(context).push(
CustomPageRoute(
page: DoctorResponsePage(),
),
);
}),
],
),
// Column(
@ -839,8 +858,8 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
onPressed: () {
openDoctorScheduleCalendar();
},
backgroundColor: AppColors.successColor,
borderColor: AppColors.successColor,
backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedColor,
textColor: Colors.white,
fontSize: 16.f,
fontWeight: FontWeight.w500,

@ -329,12 +329,19 @@ class AppointmentCard extends StatelessWidget {
flex: 1,
child: Container(
height: (isFoldable || isTablet) ? 50.h : 40.h,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.textColor, borderRadius: 10.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.transparent,
borderRadius: 10.h,
side: BorderSide(
color: AppColors.textColor,
width: 1.2,
),
),
child: Transform.flip(
flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon,
iconColor: AppColors.whiteColor,
iconColor: AppColors.textColor,
width: 24.w,
height: 24.h,
fit: BoxFit.contain,
@ -401,9 +408,10 @@ class AppointmentCard extends StatelessWidget {
return CustomButton(
text: LocaleKeys.rebookSameDoctor.tr(context: context),
onPressed: () => openDoctorScheduleCalendar(context),
backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor,
backgroundColor: AppColors.transparent,
borderColor: AppColors.textColor,
textColor: AppColors.blackColor,
borderWidth: 1.h,
fontSize: (isFoldable || isTablet) ? 12.f : 14.f,
fontWeight: FontWeight.w500,
borderRadius: 12.r,

@ -155,25 +155,27 @@ class AppointmentDoctorCard extends StatelessWidget {
icon: AppAssets.ask_doctor_icon,
iconColor: AppColors.primaryRedColor,
)
: !patientAppointmentHistoryResponseModel.isLiveCareAppointment!
? CustomButton(
text: LocaleKeys.rebookSameDoctor.tr(),
onPressed: () {
onRescheduleTap();
},
backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor,
textColor: AppColors.blackColor,
fontSize: 12.f,
fontWeight: FontWeight.w500,
borderRadius: 12.r,
padding: EdgeInsets.fromLTRB(10.w, 0, 10.w, 0),
height: 40.h,
icon: AppAssets.rebook_appointment_icon,
iconColor: AppColors.blackColor,
iconSize: 14.h,
)
: SizedBox.shrink();
:
// !patientAppointmentHistoryResponseModel.isLiveCareAppointment!
// ? CustomButton(
// text: LocaleKeys.rebookSameDoctor.tr(),
// onPressed: () {
// onRescheduleTap();
// },
// backgroundColor: AppColors.greyColor,
// borderColor: AppColors.greyColor,
// textColor: AppColors.blackColor,
// fontSize: 12.f,
// fontWeight: FontWeight.w500,
// borderRadius: 12.r,
// padding: EdgeInsets.fromLTRB(10.w, 0, 10.w, 0),
// height: 40.h,
// icon: AppAssets.rebook_appointment_icon,
// iconColor: AppColors.blackColor,
// iconSize: 14.h,
// )
// :
SizedBox.shrink();
} else {
return patientAppointmentHistoryResponseModel.isLiveCareAppointment!
? CustomButton(

@ -35,7 +35,7 @@ class EmergencyServicesPage extends StatelessWidget {
return CollapsingListView(
title: LocaleKeys.emergencyServices.tr(),
requests: () {
history: () {
emergencyServicesViewModel.changeOrderDisplayItems(OrderDislpay.ALL);
Navigator.of(context).push(CustomPageRoute(page: ErHistoryListing(), direction: AxisDirection.up));
},

@ -48,6 +48,7 @@ import 'package:hmg_patient_app_new/presentation/home/widgets/large_service_card
import 'package:hmg_patient_app_new/presentation/home/widgets/small_service_card.dart';
import 'package:hmg_patient_app_new/presentation/home/widgets/welcome_widget.dart';
import 'package:hmg_patient_app_new/presentation/insurance/insurance_home_page.dart';
import 'package:hmg_patient_app_new/presentation/insurance/widgets/insurance_update_details_card.dart';
import 'package:hmg_patient_app_new/presentation/medical_file/medical_file_page.dart';
import 'package:hmg_patient_app_new/presentation/my_family/my_family.dart';
import 'package:hmg_patient_app_new/presentation/notifications/notifications_list_page.dart';
@ -171,7 +172,11 @@ class _LandingPageState extends State<LandingPage> {
return Stack(
children: [
SingleChildScrollView(
padding: EdgeInsets.only(top: (!insuranceVM.isInsuranceLoading && insuranceVM.isInsuranceExpired) ? (MediaQuery.paddingOf(context).top + 70.h) : kToolbarHeight + 0.h, bottom: 24),
padding: EdgeInsets.only(
top: (!insuranceVM.isInsuranceLoading && insuranceVM.isInsuranceExpired && insuranceVM.isInsuranceExpiryBannerShown)
? (MediaQuery.paddingOf(context).top + 70.h)
: kToolbarHeight + 0.h,
bottom: 24),
child: Column(
spacing: 16.h,
children: [
@ -728,7 +733,7 @@ class _LandingPageState extends State<LandingPage> {
],
),
),
(!insuranceVM.isInsuranceLoading && insuranceVM.isInsuranceExpired)
(!insuranceVM.isInsuranceLoading && insuranceVM.isInsuranceExpired && insuranceVM.isInsuranceExpiryBannerShown)
? Container(
height: MediaQuery.paddingOf(context).top + 50.h,
decoration: ShapeDecoration(
@ -745,27 +750,30 @@ class _LandingPageState extends State<LandingPage> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
LocaleKeys.insuranceExpiredOrInactive.tr(context: context).toText14(color: AppColors.primaryRedColor, weight: FontWeight.w500).paddingSymmetrical(24.h, 0.h),
LocaleKeys.insuranceExpiredOrInactive.tr(context: context).toText14(color: AppColors.primaryRedColor, weight: FontWeight.w500).paddingSymmetrical(0.h, 0.h),
Row(
children: [
CustomButton(
text: LocaleKeys.updateInsurance.tr(context: context),
onPressed: () {
Navigator.of(context).push(
CustomPageRoute(
page: InsuranceHomePage(),
),
);
insuranceVM.setIsInsuranceUpdateDetailsLoading(true);
insuranceVM.getPatientInsuranceDetailsForUpdate(
appState.getAuthenticatedUser()!.patientId.toString(), appState.getAuthenticatedUser()!.patientIdentificationNo.toString());
showCommonBottomSheetWithoutHeight(context,
child: PatientInsuranceCardUpdateCard(), callBackFunc: () {}, title: "", isCloseButtonVisible: false, isFullScreen: false);
},
backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.secondaryLightRedBorderColor,
textColor: AppColors.whiteColor,
fontSize: 10.f,
textColor: Colors.white,
fontSize: 12.f,
fontWeight: FontWeight.bold,
borderRadius: 8.r,
padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
height: 36.h,
).paddingSymmetrical(24.h, 0.h),
).paddingSymmetrical(12.h, 0.h),
Icon(Icons.close, color: AppColors.primaryRedColor).onPress(() {
insuranceVM.setIsInsuranceExpiryBannerShown(false);
}),
],
),
],
@ -774,7 +782,7 @@ class _LandingPageState extends State<LandingPage> {
height: 10.h,
)
],
),
).paddingSymmetrical(24.h, 0.h),
)
: SizedBox.shrink()
],

@ -48,11 +48,11 @@ class _InsuranceHomePageState extends State<InsuranceHomePage> {
insuranceViewModel = Provider.of<InsuranceViewModel>(context, listen: false);
return CollapsingListView(
title: "${LocaleKeys.insurance.tr(context: context)} ${LocaleKeys.updateInsurance.tr(context: context)}",
history: () {
insuranceViewModel.setIsInsuranceHistoryLoading(true);
insuranceViewModel.getPatientInsuranceCardHistory();
showCommonBottomSheetWithoutHeight(context, child: InsuranceHistory(), callBackFunc: () {}, title: "", isCloseButtonVisible: false, isFullScreen: false);
},
// history: () {
// // insuranceViewModel.setIsInsuranceHistoryLoading(true);
// // insuranceViewModel.getPatientInsuranceCardHistory();
// showCommonBottomSheetWithoutHeight(context, child: InsuranceHistory(), callBackFunc: () {}, title: "", isCloseButtonVisible: false, isFullScreen: false);
// },
child: SingleChildScrollView(
child: Consumer<InsuranceViewModel>(builder: (context, insuranceVM, child) {
return Column(
@ -66,12 +66,23 @@ class _InsuranceHomePageState extends State<InsuranceHomePage> {
isLoading: true,
).paddingSymmetrical(24.h, 24.h)
: insuranceVM.patientInsuranceList.isNotEmpty
? Padding(
padding: EdgeInsets.only(top: 24.h),
child: PatientInsuranceCard(
insuranceCardDetailsModel: insuranceVM.patientInsuranceList.first,
isInsuranceExpired: DateTime.now().isAfter(DateUtil.convertStringToDate(insuranceVM.patientInsuranceList.first.cardValidTo)))
.paddingSymmetrical(24.w, 0.h),
? ListView.builder(
shrinkWrap: true,
padding: EdgeInsets.all(16.h),
physics: const BouncingScrollPhysics(),
itemBuilder: (context, index) {
return Column(
children: [
PatientInsuranceCard(
insuranceCardDetailsModel: insuranceVM.patientInsuranceList[index],
isInsuranceExpired: DateTime.now().isAfter(DateUtil.convertStringToDate(insuranceVM.patientInsuranceList.first.cardValidTo))),
SizedBox(
height: 12.h,
)
],
);
},
itemCount: insuranceVM.patientInsuranceList.length,
)
: Padding(
padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.12),

@ -105,49 +105,51 @@ class PatientInsuranceCardUpdateCard extends StatelessWidget {
iconSize: 20.w,
text: "${LocaleKeys.updateInsurance.tr(context: context)} ${LocaleKeys.updateInsuranceSubtitle.tr(context: context)}",
onPressed: () {
LoaderBottomSheet.showLoader();
getIt<MyAppointmentsViewModel>().sendPatientUpdateRequest(onSuccess: (val) {
LoaderBottomSheet.hideLoader();
insuranceViewModel.setIsInsuranceDataToBeLoaded(true);
insuranceViewModel.initInsuranceProvider();
Navigator.pop(context);
}, onError: (err) {
insuranceViewModel.updatePatientInsuranceCard(
patientID: appState.getAuthenticatedUser()!.patientId!,
patientType: appState.getAuthenticatedUser()!.patientType!,
patientIdentificationID: appState.getAuthenticatedUser()!.patientIdentificationNo!,
mobileNo: appState.getAuthenticatedUser()!.mobileNumber!,
insuranceCardImage: "",
onSuccess: (val) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
title: LocaleKeys.success.tr(context: context),
context,
child: Utils.getSuccessWidget(loadingText: LocaleKeys.insuranceRequestSubmittedSuccessfully.tr(context: context)),
callBackFunc: () {
Navigator.pop(context);
},
isFullScreen: false,
isCloseButtonVisible: false,
);
// Future.delayed(Duration(milliseconds: 2000)).then((value) async {
// Navigator.pop(context);
// });
},
onError: (err) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
title: LocaleKeys.notice.tr(context: context),
context,
child: Utils.getErrorWidget(loadingText: err.toString()),
callBackFunc: () {
Navigator.pop(context);
},
isFullScreen: false,
isCloseButtonVisible: true,
);
});
});
if (insuranceViewModel.patientInsuranceUpdateResponseModel != null) {
LoaderBottomSheet.showLoader();
getIt<MyAppointmentsViewModel>().sendPatientUpdateRequest(onSuccess: (val) {
LoaderBottomSheet.hideLoader();
insuranceViewModel.setIsInsuranceDataToBeLoaded(true);
insuranceViewModel.initInsuranceProvider();
Navigator.pop(context);
}, onError: (err) {
insuranceViewModel.updatePatientInsuranceCard(
patientID: appState.getAuthenticatedUser()!.patientId!,
patientType: appState.getAuthenticatedUser()!.patientType!,
patientIdentificationID: appState.getAuthenticatedUser()!.patientIdentificationNo!,
mobileNo: appState.getAuthenticatedUser()!.mobileNumber!,
insuranceCardImage: "",
onSuccess: (val) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
title: LocaleKeys.success.tr(context: context),
context,
child: Utils.getSuccessWidget(loadingText: LocaleKeys.insuranceRequestSubmittedSuccessfully.tr(context: context)),
callBackFunc: () {
Navigator.pop(context);
},
isFullScreen: false,
isCloseButtonVisible: false,
);
// Future.delayed(Duration(milliseconds: 2000)).then((value) async {
// Navigator.pop(context);
// });
},
onError: (err) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
title: LocaleKeys.notice.tr(context: context),
context,
child: Utils.getErrorWidget(loadingText: err.toString()),
callBackFunc: () {
Navigator.pop(context);
},
isFullScreen: false,
isCloseButtonVisible: true,
);
});
});
}
},
backgroundColor: insuranceViewModel.patientInsuranceUpdateResponseModel != null ? AppColors.successColor : AppColors.lightGrayBGColor,
borderColor: AppColors.successColor.withOpacity(0.01),

@ -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),
);
}
}

File diff suppressed because one or more lines are too long

@ -114,15 +114,15 @@ class LabOrderResultItem extends StatelessWidget {
),
CustomButton(
icon: AppAssets.view_report_icon,
iconColor: AppColors.primaryRedColor,
iconColor: AppColors.infoColor,
iconSize: 16.h,
text: LocaleKeys.viewReport.tr(context: context),
onPressed: () {
onTap();
},
backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor,
backgroundColor: AppColors.infoColor.withAlpha(20),
borderColor: AppColors.infoColor.withAlpha(0),
textColor: AppColors.infoColor,
fontSize: 14,
fontWeight: FontWeight.w500,
borderRadius: 12,

@ -522,7 +522,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
],
),
ExpandableListItem(
title: LocaleKeys.trackerAndOthers.tr(context: context).toText18(weight: FontWeight.w600),
title: LocaleKeys.healthTrackers.tr(context: context).toText18(weight: FontWeight.w600),
expandedBackgroundColor: Colors.transparent,
children: [
SizedBox(height: 10.h),
@ -1347,12 +1347,12 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
LocaleKeys.healthTrackers.tr(context: context).toText16(weight: FontWeight.w500, color: AppColors.textColor),
],
),
SizedBox(height: 16.h),
// Row(
// children: [
// LocaleKeys.healthTrackers.tr(context: context).toText16(weight: FontWeight.w500, color: AppColors.textColor),
// ],
// ),
// SizedBox(height: 16.h),
GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
@ -1391,11 +1391,11 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
],
).paddingSymmetrical(0.w, 0.0),
SizedBox(height: 16.h),
Row(
children: [
LocaleKeys.others.tr(context: context).toText16(weight: FontWeight.w500, color: AppColors.textColor),
],
),
// Row(
// children: [
// LocaleKeys.others.tr(context: context).toText16(weight: FontWeight.w500, color: AppColors.textColor),
// ],
// ),
SizedBox(height: 16.h),
GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
@ -1408,21 +1408,22 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
padding: EdgeInsets.zero,
shrinkWrap: true,
children: [
MedicalFileCard(
label: LocaleKeys.askYourDoctor.tr(context: context),
textColor: AppColors.blackColor,
backgroundColor: AppColors.whiteColor,
svgIcon: AppAssets.ask_doctor_medical_file_icon,
isLargeText: true,
iconSize: 36.w,
).onPress(() {
getIt.get<AskDoctorViewModel>().initAskDoctorViewModel();
Navigator.of(context).push(
CustomPageRoute(
page: AskDoctorPage(),
),
);
}),
// MedicalFileCard(
// label: LocaleKeys.askYourDoctor.tr(context: context),
// textColor: AppColors.blackColor,
// backgroundColor: AppColors.whiteColor,
// svgIcon: AppAssets.ask_doctor_medical_file_icon,
// isLargeText: true,
// iconSize: 36.w,
// ).onPress(() {
// getIt.get<AskDoctorViewModel>().initAskDoctorViewModel();
// Navigator.of(context).push(
// CustomPageRoute(
// page: AskDoctorPage(),
// ),
// );
// }),
// MedicalFileCard(
// label: LocaleKeys.internetPairing.tr(context: context),
// textColor: AppColors.blackColor,

Loading…
Cancel
Save