haroon_dev
haroon amjad 9 hours ago
parent 3d877ed28d
commit d703c382e5

@ -1585,5 +1585,6 @@
"darkMode": "المظهر الداكن", "darkMode": "المظهر الداكن",
"generateAiAnalysisResult": "قم بإجراء تحليل لهذا المختبر AI", "generateAiAnalysisResult": "قم بإجراء تحليل لهذا المختبر AI",
"ratings": "التقييمات", "ratings": "التقييمات",
"hmgPharmacyText": "صيدلية الحبيب، المتجر الصيدلاني الإلكتروني المتكامل الذي تقدمه لكم مجموعة خدمات الدكتور سليمان الحبيب الطبية." "hmgPharmacyText": "صيدلية الحبيب، المتجر الصيدلاني الإلكتروني المتكامل الذي تقدمه لكم مجموعة خدمات الدكتور سليمان الحبيب الطبية.",
"insuranceRequestSubmittedSuccessfully": "تم إرسال طلب تحديث بيانات التأمين بنجاح. سيتم إعلامك بمجرد الانتهاء."
} }

@ -1579,5 +1579,6 @@
"darkMode": "Dark Mode", "darkMode": "Dark Mode",
"generateAiAnalysisResult": "Generate AI analysis for this result", "generateAiAnalysisResult": "Generate AI analysis for this result",
"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."
} }

@ -200,7 +200,7 @@ class ApiClientImp implements ApiClient {
} }
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// body['PatientID'] = 2007395; // body['PatientID'] = 4774402;
// body['PatientTypeID'] = 1; // body['PatientTypeID'] = 1;
// body['PatientOutSA'] = 0; // body['PatientOutSA'] = 0;
// body['SessionID'] = "45786230487560q"; // body['SessionID'] = "45786230487560q";
@ -359,7 +359,8 @@ class ApiClientImp implements ApiClient {
onFailure( onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode, statusCode,
failureType: ServerFailure("Error While Fetching data"), // failureType: ServerFailure("Error While Fetching data"),
failureType: ServerFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']),
); );
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
} }

@ -152,6 +152,7 @@ extension SmoothContainerExtension on ShapeBorder {
BorderSide? side, BorderSide? side,
BorderRadius? customBorder, BorderRadius? customBorder,
bool hasShadow = false, bool hasShadow = false,
bool hasDenseShadow = false,
}) { }) {
final bgColor = backgroundColor ?? color; final bgColor = backgroundColor ?? color;
return ShapeDecoration( return ShapeDecoration(
@ -161,17 +162,17 @@ extension SmoothContainerExtension on ShapeBorder {
smoothness: 1, smoothness: 1,
side: side ?? BorderSide.none, side: side ?? BorderSide.none,
), ),
shadows: shadows: hasShadow
// hasShadow ? [
// ? [ BoxShadow(
// BoxShadow( color: hasDenseShadow ? const Color(0xff000000).withOpacity(.30) : const Color(0xff000000).withOpacity(.1),
// color: const Color(0xff000000).withOpacity(.05), // color: AppColors.primaryRedColor.withOpacity(.5),
// blurRadius: 32, blurRadius: 10,
// offset: const Offset(0, 0), spreadRadius: 0,
// ) offset: const Offset(0, 0),
// ] )
// : ]
[], : [],
); );
} }
} }

@ -214,7 +214,7 @@ class InsuranceViewModel extends ChangeNotifier {
(failure) async { (failure) async {
notifyListeners(); notifyListeners();
if (onError != null) { if (onError != null) {
onError(failure.toString()); onError(failure.message.toString());
} }
}, },
(apiResponse) { (apiResponse) {

@ -1580,5 +1580,6 @@ abstract class LocaleKeys {
static const generateAiAnalysisResult = 'generateAiAnalysisResult'; static const generateAiAnalysisResult = 'generateAiAnalysisResult';
static const ratings = 'ratings'; static const ratings = 'ratings';
static const hmgPharmacyText = 'hmgPharmacyText'; static const hmgPharmacyText = 'hmgPharmacyText';
static const insuranceRequestSubmittedSuccessfully = 'insuranceRequestSubmittedSuccessfully';
} }

@ -331,7 +331,6 @@ class _LandingPageState extends State<LandingPage> {
).paddingSymmetrical(24.h, 0.h).onPress(() { ).paddingSymmetrical(24.h, 0.h).onPress(() {
Navigator.of(context).push(CustomPageRoute(page: MyAppointmentsPage())); Navigator.of(context).push(CustomPageRoute(page: MyAppointmentsPage()));
}), }),
SizedBox(height: 16.h),
Consumer3<MyAppointmentsViewModel, ImmediateLiveCareViewModel, TodoSectionViewModel>( Consumer3<MyAppointmentsViewModel, ImmediateLiveCareViewModel, TodoSectionViewModel>(
builder: (context, myAppointmentsVM, immediateLiveCareVM, todoSectionVM, child) { builder: (context, myAppointmentsVM, immediateLiveCareVM, todoSectionVM, child) {
return myAppointmentsVM.isMyAppointmentsLoading return myAppointmentsVM.isMyAppointmentsLoading
@ -348,7 +347,7 @@ class _LandingPageState extends State<LandingPage> {
isLoading: true, isLoading: true,
isFromHomePage: true, isFromHomePage: true,
), ),
).paddingSymmetrical(24.h, 0.h) ).paddingSymmetrical(24.h, 16.h)
: myAppointmentsVM.patientAppointmentsHistoryList.isNotEmpty : myAppointmentsVM.patientAppointmentsHistoryList.isNotEmpty
? myAppointmentsVM.patientAppointmentsHistoryList.length == 1 ? myAppointmentsVM.patientAppointmentsHistoryList.length == 1
? Container( ? Container(
@ -399,27 +398,34 @@ class _LandingPageState extends State<LandingPage> {
), ),
), ),
) )
: Swiper( : SizedBox(
itemCount: myAppointmentsVM.isMyAppointmentsLoading height: 255.h + 20 + 30, // itemHeight + shadow padding (10 top + 10 bottom) + pagination dots space
? 3 child: Swiper(
: myAppointmentsVM.patientAppointmentsHistoryList.length < 3 itemCount: myAppointmentsVM.isMyAppointmentsLoading
? myAppointmentsVM.patientAppointmentsHistoryList.length ? 3
: 3, : myAppointmentsVM.patientAppointmentsHistoryList.length < 3
layout: SwiperLayout.STACK, ? myAppointmentsVM.patientAppointmentsHistoryList.length
loop: true, : 3,
itemWidth: MediaQuery.of(context).size.width - 48.h, layout: SwiperLayout.STACK,
indicatorLayout: PageIndicatorLayout.COLOR, loop: true,
axisDirection: AxisDirection.right, itemWidth: MediaQuery.of(context).size.width - 48.h,
controller: _controller, indicatorLayout: PageIndicatorLayout.COLOR,
itemHeight: 255.h, axisDirection: AxisDirection.right,
pagination: SwiperPagination( controller: _controller,
alignment: Alignment.bottomCenter, itemHeight: 255.h + 20,
margin: EdgeInsets.only(top: 240.h + 8 + 24), // extra space for shadow
builder: DotSwiperPaginationBuilder(color: Color(0xffD9D9D9), activeColor: AppColors.blackBgColor), pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(top: 220.h + 20 + 8 + 24),
builder: DotSwiperPaginationBuilder(color: Color(0xffD9D9D9), activeColor: AppColors.blackBgColor),
),
itemBuilder: (BuildContext context, int index) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: getIndexSwiperCard(index),
);
},
), ),
itemBuilder: (BuildContext context, int index) {
return getIndexSwiperCard(index);
},
) )
: Container( : Container(
width: double.infinity, width: double.infinity,
@ -451,7 +457,7 @@ class _LandingPageState extends State<LandingPage> {
], ],
), ),
), ),
).paddingSymmetrical(24.h, 0.h); ).paddingSymmetrical(24.h, 16.h);
}, },
), ),
@ -466,7 +472,7 @@ class _LandingPageState extends State<LandingPage> {
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor, color: AppColors.whiteColor,
borderRadius: 20.r, borderRadius: 20.r,
hasShadow: true, hasShadow: false,
side: BorderSide(color: AppColors.primaryRedColor, width: 3.h), side: BorderSide(color: AppColors.primaryRedColor, width: 3.h),
), ),
width: double.infinity, width: double.infinity,
@ -775,7 +781,7 @@ class _LandingPageState extends State<LandingPage> {
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor, color: AppColors.whiteColor,
borderRadius: 20.h, borderRadius: 20.h,
hasShadow: false, hasShadow: true,
side: BorderSide( side: BorderSide(
color: Utils.getCardBorderColor(currentStatus), color: Utils.getCardBorderColor(currentStatus),
width: 2.w, width: 2.w,
@ -1006,6 +1012,7 @@ class _LandingPageState extends State<LandingPage> {
color: AppColors.whiteColor, color: AppColors.whiteColor,
borderRadius: 24.r, borderRadius: 24.r,
hasShadow: true, hasShadow: true,
hasDenseShadow: true
), ),
child: AppointmentCard( child: AppointmentCard(
patientAppointmentHistoryResponseModel: appointment, patientAppointmentHistoryResponseModel: appointment,

@ -9,6 +9,7 @@ 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/insurance/insurance_view_model.dart'; import 'package:hmg_patient_app_new/features/insurance/insurance_view_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/lab/lab_result_item_view.dart'; import 'package:hmg_patient_app_new/presentation/lab/lab_result_item_view.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
@ -105,38 +106,47 @@ class PatientInsuranceCardUpdateCard extends StatelessWidget {
text: "${LocaleKeys.updateInsurance.tr(context: context)} ${LocaleKeys.updateInsuranceSubtitle.tr(context: context)}", text: "${LocaleKeys.updateInsurance.tr(context: context)} ${LocaleKeys.updateInsuranceSubtitle.tr(context: context)}",
onPressed: () { onPressed: () {
LoaderBottomSheet.showLoader(); LoaderBottomSheet.showLoader();
insuranceViewModel.updatePatientInsuranceCard( getIt<MyAppointmentsViewModel>().sendPatientUpdateRequest(onSuccess: (val) {
patientID: appState.getAuthenticatedUser()!.patientId!, LoaderBottomSheet.hideLoader();
patientType: appState.getAuthenticatedUser()!.patientType!, insuranceViewModel.setIsInsuranceDataToBeLoaded(true);
patientIdentificationID: appState.getAuthenticatedUser()!.patientIdentificationNo!, insuranceViewModel.initInsuranceProvider();
mobileNo: appState.getAuthenticatedUser()!.mobileNumber!, }, onError: (err) {
insuranceCardImage: "", insuranceViewModel.updatePatientInsuranceCard(
onSuccess: (val) { patientID: appState.getAuthenticatedUser()!.patientId!,
LoaderBottomSheet.hideLoader(); patientType: appState.getAuthenticatedUser()!.patientType!,
showCommonBottomSheetWithoutHeight( patientIdentificationID: appState.getAuthenticatedUser()!.patientIdentificationNo!,
title: LocaleKeys.success.tr(context: context), mobileNo: appState.getAuthenticatedUser()!.mobileNumber!,
context, insuranceCardImage: "",
child: Utils.getSuccessWidget(loadingText: LocaleKeys.success.tr(context: context)), onSuccess: (val) {
callBackFunc: () { 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); Navigator.pop(context);
}, });
isFullScreen: false, },
isCloseButtonVisible: true, onError: (err) {
); LoaderBottomSheet.hideLoader();
}, showCommonBottomSheetWithoutHeight(
onError: (err) { title: LocaleKeys.notice.tr(context: context),
LoaderBottomSheet.hideLoader(); context,
showCommonBottomSheetWithoutHeight( child: Utils.getErrorWidget(loadingText: err.toString()),
title: LocaleKeys.notice.tr(context: context), callBackFunc: () {
context, Navigator.pop(context);
child: Utils.getErrorWidget(loadingText: err.toString()), },
callBackFunc: () { isFullScreen: false,
Navigator.pop(context); isCloseButtonVisible: true,
}, );
isFullScreen: false, });
isCloseButtonVisible: true, });
);
});
}, },
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),

@ -98,46 +98,53 @@ class ProfileSettingsState extends State<ProfileSettings> {
}, },
isClose: true, isClose: true,
child: SingleChildScrollView( child: SingleChildScrollView(
padding: EdgeInsets.only(top: 24.h, bottom: 24.h), padding: EdgeInsets.only(top: 0.h, bottom: 24.h),
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
child: Consumer2<ProfileSettingsViewModel, MedicalFileViewModel>( child: Consumer2<ProfileSettingsViewModel, MedicalFileViewModel>(
builder: (context, profileVm, medicalVm, child) { builder: (context, profileVm, medicalVm, child) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Swiper( SizedBox(
itemCount: medicalVm.patientFamilyFiles.length, height: dynamicItemHeight(context) + 20 + 30, // itemHeight + shadow padding (10 top + 10 bottom) + pagination dots space
layout: SwiperLayout.STACK, child: Swiper(
loop: true, itemCount: medicalVm.patientFamilyFiles.length,
itemHeight: dynamicItemHeight(context), layout: SwiperLayout.STACK,
itemWidth: SizeUtils.width - 30.w, loop: true,
indicatorLayout: PageIndicatorLayout.COLOR, itemHeight: dynamicItemHeight(context) + 20,
axisDirection: AxisDirection.right, // extra space for shadow
controller: _controller, itemWidth: SizeUtils.width - 30.w,
pagination: SwiperPagination( indicatorLayout: PageIndicatorLayout.COLOR,
alignment: Alignment.bottomCenter, axisDirection: AxisDirection.right,
margin: EdgeInsets.only(top: (210.h + 8.h + 24.h)), controller: _controller,
builder: DotSwiperPaginationBuilder(color: Color(0xffD9D9D9), activeColor: AppColors.blackBgColor), pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(top: (180.h + 20 + 8.h + 24.h)),
builder: DotSwiperPaginationBuilder(color: Color(0xffD9D9D9), activeColor: AppColors.blackBgColor),
),
itemBuilder: (BuildContext context, int index) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: FamilyCardWidget(
profile: medicalVm.patientFamilyFiles[index],
onAddFamilyMemberPress: () {
DialogService dialogService = getIt.get<DialogService>();
dialogService.showAddFamilyFileSheet(
label: LocaleKeys.addFamilyMember.tr(context: context),
message: LocaleKeys.pleaseFillBelowFieldToAddNewFamilyMember.tr(context: context),
onVerificationPress: () {
medicalVm.addFamilyFile(otpTypeEnum: OTPTypeEnum.sms);
});
},
onFamilySwitchPress: (FamilyFileResponseModelLists profile) {
medicalVm.switchFamilyFiles(responseID: profile.responseId, patientID: profile.patientId, phoneNumber: profile.mobileNumber);
},
).paddingOnly(right: 16.w, left: 8.w),
);
},
), ),
itemBuilder: (BuildContext context, int index) {
return FamilyCardWidget(
profile: medicalVm.patientFamilyFiles[index],
onAddFamilyMemberPress: () {
DialogService dialogService = getIt.get<DialogService>();
dialogService.showAddFamilyFileSheet(
label: LocaleKeys.addFamilyMember.tr(context: context),
message: LocaleKeys.pleaseFillBelowFieldToAddNewFamilyMember.tr(context: context),
onVerificationPress: () {
medicalVm.addFamilyFile(otpTypeEnum: OTPTypeEnum.sms);
});
},
onFamilySwitchPress: (FamilyFileResponseModelLists profile) {
medicalVm.switchFamilyFiles(responseID: profile.responseId, patientID: profile.patientId, phoneNumber: profile.mobileNumber);
},
).paddingOnly(right: 16.w, left: 8.w);
},
), ),
SizedBox(height: 5.h), SizedBox(height: 16.h),
GridView( GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: isTablet ? 3 : 2), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: isTablet ? 3 : 2),
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
@ -362,9 +369,7 @@ class FamilyCardWidget extends StatelessWidget {
return Container( return Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor, color: AppColors.whiteColor,
borderRadius: 24.r, borderRadius: 24.r, hasShadow: true, hasDenseShadow: true),
hasShadow: true,
),
child: Column( child: Column(
children: [ children: [
Column( Column(
@ -409,10 +414,11 @@ class FamilyCardWidget extends StatelessWidget {
iconColor: AppColors.primaryRedColor) iconColor: AppColors.primaryRedColor)
: SizedBox(), : SizedBox(),
Consumer<InsuranceViewModel>(builder: (context, insuranceVM, child) { Consumer<InsuranceViewModel>(builder: (context, insuranceVM, child) {
return AppCustomChipWidget( return isActive
icon: insuranceVM.isInsuranceExpired ? AppCustomChipWidget(
? AppAssets.cancel_circle_icon icon: insuranceVM.isInsuranceExpired
: insuranceVM.isInsuranceActive ? AppAssets.cancel_circle_icon
: insuranceVM.isInsuranceActive
? AppAssets.insurance_active_icon ? AppAssets.insurance_active_icon
: AppAssets.alertSquare, : AppAssets.alertSquare,
labelText: insuranceVM.isInsuranceExpired labelText: insuranceVM.isInsuranceExpired
@ -468,7 +474,8 @@ class FamilyCardWidget extends StatelessWidget {
? AppColors.successColor.withOpacity(0.1) ? AppColors.successColor.withOpacity(0.1)
: AppColors.warningColorYellow.withOpacity(0.1), : AppColors.warningColorYellow.withOpacity(0.1),
labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: insuranceVM.isInsuranceActive ? 6.w : 0.w), labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: insuranceVM.isInsuranceActive ? 6.w : 0.w),
).toShimmer2(isShow: insuranceVM.isInsuranceLoading); ).toShimmer2(isShow: insuranceVM.isInsuranceLoading)
: SizedBox.shrink();
}), }),
], ],
), ),

Loading…
Cancel
Save