haroon_dev
haroon amjad 6 hours ago
parent 3d877ed28d
commit d703c382e5

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

@ -1579,5 +1579,6 @@
"darkMode": "Dark Mode",
"generateAiAnalysisResult": "Generate AI analysis for this result",
"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['PatientID'] = 2007395;
// body['PatientID'] = 4774402;
// body['PatientTypeID'] = 1;
// body['PatientOutSA'] = 0;
// body['SessionID'] = "45786230487560q";
@ -359,7 +359,8 @@ class ApiClientImp implements ApiClient {
onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
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);
}

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

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

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

@ -331,7 +331,6 @@ class _LandingPageState extends State<LandingPage> {
).paddingSymmetrical(24.h, 0.h).onPress(() {
Navigator.of(context).push(CustomPageRoute(page: MyAppointmentsPage()));
}),
SizedBox(height: 16.h),
Consumer3<MyAppointmentsViewModel, ImmediateLiveCareViewModel, TodoSectionViewModel>(
builder: (context, myAppointmentsVM, immediateLiveCareVM, todoSectionVM, child) {
return myAppointmentsVM.isMyAppointmentsLoading
@ -348,7 +347,7 @@ class _LandingPageState extends State<LandingPage> {
isLoading: true,
isFromHomePage: true,
),
).paddingSymmetrical(24.h, 0.h)
).paddingSymmetrical(24.h, 16.h)
: myAppointmentsVM.patientAppointmentsHistoryList.isNotEmpty
? myAppointmentsVM.patientAppointmentsHistoryList.length == 1
? Container(
@ -399,27 +398,34 @@ class _LandingPageState extends State<LandingPage> {
),
),
)
: Swiper(
itemCount: myAppointmentsVM.isMyAppointmentsLoading
? 3
: myAppointmentsVM.patientAppointmentsHistoryList.length < 3
? myAppointmentsVM.patientAppointmentsHistoryList.length
: 3,
layout: SwiperLayout.STACK,
loop: true,
itemWidth: MediaQuery.of(context).size.width - 48.h,
indicatorLayout: PageIndicatorLayout.COLOR,
axisDirection: AxisDirection.right,
controller: _controller,
itemHeight: 255.h,
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(top: 240.h + 8 + 24),
builder: DotSwiperPaginationBuilder(color: Color(0xffD9D9D9), activeColor: AppColors.blackBgColor),
: SizedBox(
height: 255.h + 20 + 30, // itemHeight + shadow padding (10 top + 10 bottom) + pagination dots space
child: Swiper(
itemCount: myAppointmentsVM.isMyAppointmentsLoading
? 3
: myAppointmentsVM.patientAppointmentsHistoryList.length < 3
? myAppointmentsVM.patientAppointmentsHistoryList.length
: 3,
layout: SwiperLayout.STACK,
loop: true,
itemWidth: MediaQuery.of(context).size.width - 48.h,
indicatorLayout: PageIndicatorLayout.COLOR,
axisDirection: AxisDirection.right,
controller: _controller,
itemHeight: 255.h + 20,
// extra space for shadow
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(
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(
color: AppColors.whiteColor,
borderRadius: 20.r,
hasShadow: true,
hasShadow: false,
side: BorderSide(color: AppColors.primaryRedColor, width: 3.h),
),
width: double.infinity,
@ -775,7 +781,7 @@ class _LandingPageState extends State<LandingPage> {
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 20.h,
hasShadow: false,
hasShadow: true,
side: BorderSide(
color: Utils.getCardBorderColor(currentStatus),
width: 2.w,
@ -1006,6 +1012,7 @@ class _LandingPageState extends State<LandingPage> {
color: AppColors.whiteColor,
borderRadius: 24.r,
hasShadow: true,
hasDenseShadow: true
),
child: AppointmentCard(
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/widget_extensions.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/presentation/lab/lab_result_item_view.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)}",
onPressed: () {
LoaderBottomSheet.showLoader();
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.success.tr(context: context)),
callBackFunc: () {
getIt<MyAppointmentsViewModel>().sendPatientUpdateRequest(onSuccess: (val) {
LoaderBottomSheet.hideLoader();
insuranceViewModel.setIsInsuranceDataToBeLoaded(true);
insuranceViewModel.initInsuranceProvider();
}, 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);
},
isFullScreen: false,
isCloseButtonVisible: true,
);
},
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,
);
});
});
},
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),

@ -98,46 +98,53 @@ class ProfileSettingsState extends State<ProfileSettings> {
},
isClose: true,
child: SingleChildScrollView(
padding: EdgeInsets.only(top: 24.h, bottom: 24.h),
padding: EdgeInsets.only(top: 0.h, bottom: 24.h),
physics: NeverScrollableScrollPhysics(),
child: Consumer2<ProfileSettingsViewModel, MedicalFileViewModel>(
builder: (context, profileVm, medicalVm, child) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Swiper(
itemCount: medicalVm.patientFamilyFiles.length,
layout: SwiperLayout.STACK,
loop: true,
itemHeight: dynamicItemHeight(context),
itemWidth: SizeUtils.width - 30.w,
indicatorLayout: PageIndicatorLayout.COLOR,
axisDirection: AxisDirection.right,
controller: _controller,
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(top: (210.h + 8.h + 24.h)),
builder: DotSwiperPaginationBuilder(color: Color(0xffD9D9D9), activeColor: AppColors.blackBgColor),
SizedBox(
height: dynamicItemHeight(context) + 20 + 30, // itemHeight + shadow padding (10 top + 10 bottom) + pagination dots space
child: Swiper(
itemCount: medicalVm.patientFamilyFiles.length,
layout: SwiperLayout.STACK,
loop: true,
itemHeight: dynamicItemHeight(context) + 20,
// extra space for shadow
itemWidth: SizeUtils.width - 30.w,
indicatorLayout: PageIndicatorLayout.COLOR,
axisDirection: AxisDirection.right,
controller: _controller,
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(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: isTablet ? 3 : 2),
physics: const NeverScrollableScrollPhysics(),
@ -362,9 +369,7 @@ class FamilyCardWidget extends StatelessWidget {
return Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.r,
hasShadow: true,
),
borderRadius: 24.r, hasShadow: true, hasDenseShadow: true),
child: Column(
children: [
Column(
@ -409,10 +414,11 @@ class FamilyCardWidget extends StatelessWidget {
iconColor: AppColors.primaryRedColor)
: SizedBox(),
Consumer<InsuranceViewModel>(builder: (context, insuranceVM, child) {
return AppCustomChipWidget(
icon: insuranceVM.isInsuranceExpired
? AppAssets.cancel_circle_icon
: insuranceVM.isInsuranceActive
return isActive
? AppCustomChipWidget(
icon: insuranceVM.isInsuranceExpired
? AppAssets.cancel_circle_icon
: insuranceVM.isInsuranceActive
? AppAssets.insurance_active_icon
: AppAssets.alertSquare,
labelText: insuranceVM.isInsuranceExpired
@ -468,7 +474,8 @@ class FamilyCardWidget extends StatelessWidget {
? AppColors.successColor.withOpacity(0.1)
: AppColors.warningColorYellow.withOpacity(0.1),
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