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

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

@ -1581,5 +1581,7 @@
"ratings": "Ratings", "ratings": "Ratings",
"hmgPharmacyText": "Al Habib Pharmacy, the complete online Pharmaceutical store brought to you by Dr. Sulaiman Al Habib Medical Services Group.", "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.", "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['TokenID'] = "@dm!n";
// body['PatientID'] = 4774402; // body['PatientID'] = 1231755;
// body['PatientTypeID'] = 1; // body['PatientTypeID'] = 1;
// body['PatientOutSA'] = 0; // body['PatientOutSA'] = 0;
// body['SessionID'] = "45786230487560q"; // body['SessionID'] = "45786230487560q";

@ -1,7 +1,9 @@
import 'package:flutter/material.dart'; 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/core/enums.dart';
import 'package:hmg_patient_app_new/extensions/int_extensions.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/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:hmg_patient_app_new/theme/colors.dart';
import 'package:shimmer/shimmer.dart'; import 'package:shimmer/shimmer.dart';
import 'package:sizer/sizer.dart'; import 'package:sizer/sizer.dart';
@ -166,7 +168,7 @@ extension SmoothContainerExtension on ShapeBorder {
? [ ? [
BoxShadow( BoxShadow(
// color: hasDenseShadow ? const Color(0xff000000).withOpacity(.06) : const Color(0xff000000).withOpacity(.1), // 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, blurRadius: 0,
spreadRadius: 0, spreadRadius: 0,
offset: const Offset(1, 0), offset: const Offset(1, 0),

@ -47,7 +47,7 @@ class AskDoctorRepoImp implements AskDoctorRepo {
try { try {
final list = response['PatientDoctorAppointmentResultList']; 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>>( apiResponse = GenericApiModel<List<AskDoctorAppointmentHistoryList>>(
messageStatus: messageStatus, messageStatus: messageStatus,

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

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

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

@ -1582,5 +1582,7 @@ abstract class LocaleKeys {
static const hmgPharmacyText = 'hmgPharmacyText'; static const hmgPharmacyText = 'hmgPharmacyText';
static const insuranceRequestSubmittedSuccessfully = 'insuranceRequestSubmittedSuccessfully'; static const insuranceRequestSubmittedSuccessfully = 'insuranceRequestSubmittedSuccessfully';
static const updatingEmailAddress = 'updatingEmailAddress'; 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/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.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/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/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/book_appointments/models/resp_models/doctors_list_response_model.dart';
import 'package:hmg_patient_app_new/features/contact_us/contact_us_view_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_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/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/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/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/contact_us/feedback_page.dart';
import 'package:hmg_patient_app_new/presentation/prescriptions/prescription_detail_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( // Column(
@ -839,8 +858,8 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
onPressed: () { onPressed: () {
openDoctorScheduleCalendar(); openDoctorScheduleCalendar();
}, },
backgroundColor: AppColors.successColor, backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.successColor, borderColor: AppColors.primaryRedColor,
textColor: Colors.white, textColor: Colors.white,
fontSize: 16.f, fontSize: 16.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,

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

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

@ -35,7 +35,7 @@ class EmergencyServicesPage extends StatelessWidget {
return CollapsingListView( return CollapsingListView(
title: LocaleKeys.emergencyServices.tr(), title: LocaleKeys.emergencyServices.tr(),
requests: () { history: () {
emergencyServicesViewModel.changeOrderDisplayItems(OrderDislpay.ALL); emergencyServicesViewModel.changeOrderDisplayItems(OrderDislpay.ALL);
Navigator.of(context).push(CustomPageRoute(page: ErHistoryListing(), direction: AxisDirection.up)); 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/small_service_card.dart';
import 'package:hmg_patient_app_new/presentation/home/widgets/welcome_widget.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/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/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/my_family/my_family.dart';
import 'package:hmg_patient_app_new/presentation/notifications/notifications_list_page.dart'; import 'package:hmg_patient_app_new/presentation/notifications/notifications_list_page.dart';
@ -171,7 +172,11 @@ class _LandingPageState extends State<LandingPage> {
return Stack( return Stack(
children: [ children: [
SingleChildScrollView( 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( child: Column(
spacing: 16.h, spacing: 16.h,
children: [ children: [
@ -728,7 +733,7 @@ class _LandingPageState extends State<LandingPage> {
], ],
), ),
), ),
(!insuranceVM.isInsuranceLoading && insuranceVM.isInsuranceExpired) (!insuranceVM.isInsuranceLoading && insuranceVM.isInsuranceExpired && insuranceVM.isInsuranceExpiryBannerShown)
? Container( ? Container(
height: MediaQuery.paddingOf(context).top + 50.h, height: MediaQuery.paddingOf(context).top + 50.h,
decoration: ShapeDecoration( decoration: ShapeDecoration(
@ -745,27 +750,30 @@ class _LandingPageState extends State<LandingPage> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ 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( Row(
children: [ children: [
CustomButton( CustomButton(
text: LocaleKeys.updateInsurance.tr(context: context), text: LocaleKeys.updateInsurance.tr(context: context),
onPressed: () { onPressed: () {
Navigator.of(context).push( insuranceVM.setIsInsuranceUpdateDetailsLoading(true);
CustomPageRoute( insuranceVM.getPatientInsuranceDetailsForUpdate(
page: InsuranceHomePage(), appState.getAuthenticatedUser()!.patientId.toString(), appState.getAuthenticatedUser()!.patientIdentificationNo.toString());
), showCommonBottomSheetWithoutHeight(context,
); child: PatientInsuranceCardUpdateCard(), callBackFunc: () {}, title: "", isCloseButtonVisible: false, isFullScreen: false);
}, },
backgroundColor: AppColors.primaryRedColor, backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.secondaryLightRedBorderColor, borderColor: AppColors.secondaryLightRedBorderColor,
textColor: AppColors.whiteColor, textColor: Colors.white,
fontSize: 10.f, fontSize: 12.f,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
borderRadius: 8.r, borderRadius: 8.r,
padding: EdgeInsets.fromLTRB(15, 0, 15, 0), padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
height: 36.h, 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, height: 10.h,
) )
], ],
), ).paddingSymmetrical(24.h, 0.h),
) )
: SizedBox.shrink() : SizedBox.shrink()
], ],

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

@ -105,6 +105,7 @@ class PatientInsuranceCardUpdateCard extends StatelessWidget {
iconSize: 20.w, iconSize: 20.w,
text: "${LocaleKeys.updateInsurance.tr(context: context)} ${LocaleKeys.updateInsuranceSubtitle.tr(context: context)}", text: "${LocaleKeys.updateInsurance.tr(context: context)} ${LocaleKeys.updateInsuranceSubtitle.tr(context: context)}",
onPressed: () { onPressed: () {
if (insuranceViewModel.patientInsuranceUpdateResponseModel != null) {
LoaderBottomSheet.showLoader(); LoaderBottomSheet.showLoader();
getIt<MyAppointmentsViewModel>().sendPatientUpdateRequest(onSuccess: (val) { getIt<MyAppointmentsViewModel>().sendPatientUpdateRequest(onSuccess: (val) {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
@ -148,6 +149,7 @@ class PatientInsuranceCardUpdateCard extends StatelessWidget {
); );
}); });
}); });
}
}, },
backgroundColor: insuranceViewModel.patientInsuranceUpdateResponseModel != null ? AppColors.successColor : AppColors.lightGrayBGColor, backgroundColor: insuranceViewModel.patientInsuranceUpdateResponseModel != null ? AppColors.successColor : AppColors.lightGrayBGColor,
borderColor: AppColors.successColor.withOpacity(0.01), borderColor: AppColors.successColor.withOpacity(0.01),

@ -53,26 +53,30 @@ class PatientInsuranceCard extends StatelessWidget {
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * 0.4, width: MediaQuery.of(context).size.width * 0.4,
child: "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}".toText18(isBold: true, textOverflow: TextOverflow.clip, isEnglishOnly: true)), 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( AppCustomChipWidget(
icon: insuranceViewModel.isInsuranceExpired icon: isCurrentPatientInsuranceExpired(insuranceCardDetailsModel.cardValidTo!)
? AppAssets.cancel_circle_icon ? AppAssets.cancel_circle_icon
: insuranceViewModel.isInsuranceActive : insuranceViewModel.isInsuranceActive
? AppAssets.insurance_active_icon ? AppAssets.insurance_active_icon
: AppAssets.alertSquare, : AppAssets.alertSquare,
labelText: insuranceViewModel.isInsuranceExpired labelText: isCurrentPatientInsuranceExpired(insuranceCardDetailsModel.cardValidTo!)
? LocaleKeys.insuranceExpired.tr(context: context) ? LocaleKeys.insuranceExpired.tr(context: context)
: insuranceViewModel.isInsuranceActive : insuranceViewModel.isInsuranceActive
? LocaleKeys.insuranceActive.tr(context: context) ? LocaleKeys.insuranceActive.tr(context: context)
: LocaleKeys.insuranceInActive.tr(context: context), : LocaleKeys.insuranceInActive.tr(context: context),
iconColor: insuranceViewModel.isInsuranceExpired iconColor: isCurrentPatientInsuranceExpired(insuranceCardDetailsModel.cardValidTo!)
? AppColors.primaryRedColor ? AppColors.primaryRedColor
: insuranceViewModel.isInsuranceActive : insuranceViewModel.isInsuranceActive
? AppColors.successColor ? AppColors.successColor
: AppColors.warningColorYellow, : AppColors.warningColorYellow,
textColor: insuranceViewModel.isInsuranceExpired textColor: isCurrentPatientInsuranceExpired(insuranceCardDetailsModel.cardValidTo!)
? AppColors.primaryRedColor ? AppColors.primaryRedColor
: insuranceViewModel.isInsuranceActive : insuranceViewModel.isInsuranceActive
? AppColors.successColor ? AppColors.successColor
@ -110,7 +114,7 @@ class PatientInsuranceCard extends StatelessWidget {
// ); // );
} }
}, },
backgroundColor: insuranceViewModel.isInsuranceExpired backgroundColor: isCurrentPatientInsuranceExpired(insuranceCardDetailsModel.cardValidTo!)
? AppColors.primaryRedColor.withOpacity(0.1) ? AppColors.primaryRedColor.withOpacity(0.1)
: insuranceViewModel.isInsuranceActive : insuranceViewModel.isInsuranceActive
? AppColors.successColor.withOpacity(0.1) ? AppColors.successColor.withOpacity(0.1)
@ -130,7 +134,23 @@ class PatientInsuranceCard extends StatelessWidget {
), ),
SizedBox(height: 12.h), SizedBox(height: 12.h),
insuranceCardDetailsModel.groupName!.toText12(isBold: true), insuranceCardDetailsModel.groupName!.toText12(isBold: true),
Row(
children: [
insuranceCardDetailsModel.companyName!.toText12(isBold: true), 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), SizedBox(height: 8.h),
Wrap( Wrap(
direction: Axis.horizontal, direction: Axis.horizontal,
@ -150,9 +170,10 @@ class PatientInsuranceCard extends StatelessWidget {
isInsuranceExpired isInsuranceExpired
? CustomButton( ? CustomButton(
icon: AppAssets.update_insurance_card_icon, icon: AppAssets.update_insurance_card_icon,
iconColor: AppColors.successColor, iconColor: AppColors.warningColorYellow,
iconSize: 15.h, 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: () { onPressed: () {
insuranceViewModel.setIsInsuranceUpdateDetailsLoading(true); insuranceViewModel.setIsInsuranceUpdateDetailsLoading(true);
insuranceViewModel.getPatientInsuranceDetailsForUpdate( insuranceViewModel.getPatientInsuranceDetailsForUpdate(
@ -165,9 +186,9 @@ class PatientInsuranceCard extends StatelessWidget {
isCloseButtonVisible: false, isCloseButtonVisible: false,
isFullScreen: false); isFullScreen: false);
}, },
backgroundColor: AppColors.bgGreenColor.withOpacity(0.20), backgroundColor: AppColors.warningColorYellow.withOpacity(0.20),
borderColor: AppColors.bgGreenColor.withOpacity(0.0), borderColor: AppColors.warningColorYellow.withOpacity(0.0),
textColor: AppColors.bgGreenColor, textColor: AppColors.warningColorYellow,
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
borderRadius: 12, borderRadius: 12,
@ -180,4 +201,10 @@ class PatientInsuranceCard extends StatelessWidget {
), ),
).paddingSymmetrical(0.h, 0.h); ).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( CustomButton(
icon: AppAssets.view_report_icon, icon: AppAssets.view_report_icon,
iconColor: AppColors.primaryRedColor, iconColor: AppColors.infoColor,
iconSize: 16.h, iconSize: 16.h,
text: LocaleKeys.viewReport.tr(context: context), text: LocaleKeys.viewReport.tr(context: context),
onPressed: () { onPressed: () {
onTap(); onTap();
}, },
backgroundColor: AppColors.secondaryLightRedColor, backgroundColor: AppColors.infoColor.withAlpha(20),
borderColor: AppColors.secondaryLightRedColor, borderColor: AppColors.infoColor.withAlpha(0),
textColor: AppColors.primaryRedColor, textColor: AppColors.infoColor,
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
borderRadius: 12, borderRadius: 12,

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

Loading…
Cancel
Save