pull/216/head
haroon amjad 16 hours ago
parent 6939630ce0
commit 572c37785b

File diff suppressed because one or more lines are too long

@ -1249,7 +1249,7 @@
"quickLinks": "روابط سريعة", "quickLinks": "روابط سريعة",
"viewMedicalFileLandingPage": "عرض الملف الطبي", "viewMedicalFileLandingPage": "عرض الملف الطبي",
"immediateLiveCareRequest": "طلب لايف كير فوري", "immediateLiveCareRequest": "طلب لايف كير فوري",
"yourTurnIsAfterPatients": "دورك بعد {count} مريض.", "yourTurnIsAfterPatients": "دورك بعد {count} مريض. يرجى الانتظار حتى يحين دورك، وسيناديك الطبيب قريباً.",
"dontHaveHHCOrders": "ليس لديك أي أوامر رعاية صحية منزلية حتى الآن.", "dontHaveHHCOrders": "ليس لديك أي أوامر رعاية صحية منزلية حتى الآن.",
"hhcOrders": "أوامر الرعاية الصحية المنزلية", "hhcOrders": "أوامر الرعاية الصحية المنزلية",
"requestedServices": "الخدمات المطلوبة", "requestedServices": "الخدمات المطلوبة",
@ -1689,5 +1689,6 @@
"openGallery": "افتح المعرض", "openGallery": "افتح المعرض",
"openFiles": "فتح الملفات", "openFiles": "فتح الملفات",
"generateAiAnalysisRadResult": "بإنشاء تحليل الذكاء الاصطناعي لهذا التقرير", "generateAiAnalysisRadResult": "بإنشاء تحليل الذكاء الاصطناعي لهذا التقرير",
"grantLocationPermission": "يرجى منح إذن الوصول إلى الموقع من إعدادات التطبيق للحصول على نتائج أفضل." "grantLocationPermission": "يرجى منح إذن الوصول إلى الموقع من إعدادات التطبيق للحصول على نتائج أفضل.",
"NoBookedAppointments": "لا توجد مواعيد محجوزة"
} }

@ -1681,5 +1681,6 @@
"openGallery": "Open Gallery", "openGallery": "Open Gallery",
"openFiles": "Open Files", "openFiles": "Open Files",
"generateAiAnalysisRadResult": "Generate AI analysis for this result", "generateAiAnalysisRadResult": "Generate AI analysis for this result",
"grantLocationPermission": "Please grant location permission from app settings to see better results." "grantLocationPermission": "Please grant location permission from app settings to see better results.",
"NoBookedAppointments": "No Booked Appointments"
} }

@ -415,4 +415,6 @@ class AppAnimations {
static const String ambulance = '$lottieBasePath/ambulance.json'; static const String ambulance = '$lottieBasePath/ambulance.json';
static const String ambulanceAlert = '$lottieBasePath/ambulance_alert.json'; static const String ambulanceAlert = '$lottieBasePath/ambulance_alert.json';
static const String rrtAmbulance = '$lottieBasePath/rrt_ambulance.json'; static const String rrtAmbulance = '$lottieBasePath/rrt_ambulance.json';
static const String hourGlass = '$lottieBasePath/HourGlass.json';
} }

@ -402,7 +402,11 @@ class BookAppointmentsViewModel extends ChangeNotifier {
refreshDoctorsList() { refreshDoctorsList() {
setIsDoctorsListLoading(true); setIsDoctorsListLoading(true);
getDoctorsList(isNearest: isNearestAppointmentSelected); if(selectedClinic.clinicID == 17) {
getDentalChiefComplaintDoctorsList(projectID: currentlySelectedHospitalFromRegionFlow != null ? int.parse(currentlySelectedHospitalFromRegionFlow!) : 0);
} else {
getDoctorsList(isNearest: isNearestAppointmentSelected);
}
} }
setIsNearestAppointmentSelected(bool isNearestAppointmentSelected) { setIsNearestAppointmentSelected(bool isNearestAppointmentSelected) {
@ -861,8 +865,8 @@ class BookAppointmentsViewModel extends ChangeNotifier {
} }
initialSlotDuration = apiResponse.data["InitialSlotDuration"]; initialSlotDuration = apiResponse.data["InitialSlotDuration"];
freeSlotsResponse = apiResponse.data['FreeTimeSlots']; freeSlotsResponse = apiResponse.data['FreeTimeSlots'];
// isWaitingAppointmentAvailable = apiResponse.data["IsAllowToBookWaitingAppointment"]; isWaitingAppointmentAvailable = apiResponse.data["IsAllowToBookWaitingAppointment"];
isWaitingAppointmentAvailable = true; // isWaitingAppointmentAvailable = true;
freeSlotsResponse.forEach((element) { freeSlotsResponse.forEach((element) {
// date = (isLiveCareSchedule != null && isLiveCareSchedule) // date = (isLiveCareSchedule != null && isLiveCareSchedule)
@ -1466,7 +1470,10 @@ class BookAppointmentsViewModel extends ChangeNotifier {
} }
Future<void> getDentalChiefComplaintDoctorsList({int projectID = 0, Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getDentalChiefComplaintDoctorsList({int projectID = 0, Function(dynamic)? onSuccess, Function(String)? onError}) async {
setIsNearestAppointmentSelected(false);
doctorsList.clear(); doctorsList.clear();
notifyListeners();
projectID = currentlySelectedHospitalFromRegionFlow != null ? int.parse(currentlySelectedHospitalFromRegionFlow!) : projectID; projectID = currentlySelectedHospitalFromRegionFlow != null ? int.parse(currentlySelectedHospitalFromRegionFlow!) : projectID;
final result = await bookAppointmentsRepo.getDentalChiefComplaintDoctorsList(projectID, selectedChiefComplaintID); final result = await bookAppointmentsRepo.getDentalChiefComplaintDoctorsList(projectID, selectedChiefComplaintID);
@ -1485,6 +1492,7 @@ class BookAppointmentsViewModel extends ChangeNotifier {
// clearSearchFilters(); // clearSearchFilters();
// getFiltersFromDoctorList(); // getFiltersFromDoctorList();
_groupDoctorsList(); _groupDoctorsList();
setIsNearestAppointmentSelected(isNearestAppointmentSelected);
notifyListeners(); notifyListeners();
if (onSuccess != null) { if (onSuccess != null) {
onSuccess(apiResponse); onSuccess(apiResponse);

@ -713,7 +713,7 @@ class EmergencyServicesViewModel extends ChangeNotifier {
appointments = response.data; appointments = response.data;
if (appointments?.isEmpty == true) { if (appointments?.isEmpty == true) {
haveAnAppointment = false; haveAnAppointment = false;
dialogService.showErrorBottomSheet(message: "Unable to Fetch Appointment"); dialogService.showErrorBottomSheet(message: LocaleKeys.NoBookedAppointments.tr());
} }
notifyListeners(); notifyListeners();
}); });

@ -1681,5 +1681,6 @@ abstract class LocaleKeys {
static const openFiles = 'openFiles'; static const openFiles = 'openFiles';
static const generateAiAnalysisRadResult = 'generateAiAnalysisRadResult'; static const generateAiAnalysisRadResult = 'generateAiAnalysisRadResult';
static const grantLocationPermission = 'grantLocationPermission'; static const grantLocationPermission = 'grantLocationPermission';
static const NoBookedAppointments = 'NoBookedAppointments';
} }

@ -10,6 +10,7 @@ import 'package:flutter/services.dart';
import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/core/dependencies.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/theme/colors.dart';
import 'package:hmg_patient_app_new/features/ask_doctor/ask_doctor_view_model.dart'; import 'package:hmg_patient_app_new/features/ask_doctor/ask_doctor_view_model.dart';
import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart'; import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart';
import 'package:hmg_patient_app_new/features/blood_donation/blood_donation_view_model.dart'; import 'package:hmg_patient_app_new/features/blood_donation/blood_donation_view_model.dart';
@ -50,6 +51,7 @@ import 'package:hmg_patient_app_new/routes/app_routes.dart';
import 'package:hmg_patient_app_new/services/logger_service.dart'; import 'package:hmg_patient_app_new/services/logger_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart'; import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:hmg_patient_app_new/theme/app_theme.dart'; import 'package:hmg_patient_app_new/theme/app_theme.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/date_range_selector/viewmodel/date_range_view_model.dart' show DateRangeSelectorRangeViewModel; import 'package:hmg_patient_app_new/widgets/date_range_selector/viewmodel/date_range_view_model.dart' show DateRangeSelectorRangeViewModel;
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:provider/single_child_widget.dart'; import 'package:provider/single_child_widget.dart';

@ -243,42 +243,123 @@ class AppointmentCard extends StatelessWidget {
(patientAppointmentHistoryResponseModel.isExecludeDoctor ?? false) || (patientAppointmentHistoryResponseModel.isExecludeDoctor ?? false) ||
!Utils.isClinicAllowedForRebook(patientAppointmentHistoryResponseModel.clinicID ?? 0))) && !Utils.isClinicAllowedForRebook(patientAppointmentHistoryResponseModel.clinicID ?? 0))) &&
AppointmentType.isArrived(patientAppointmentHistoryResponseModel)) { AppointmentType.isArrived(patientAppointmentHistoryResponseModel)) {
return CustomButton( if (((patientAppointmentHistoryResponseModel.isLiveCareAppointment ?? false) &&
text: isFromMedicalReport ? LocaleKeys.selectAppointment.tr(context: context) : LocaleKeys.viewDetails.tr(context: context), DateTime.now().difference(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate)).inDays <= 15)) {
onPressed: () { return Row(
if (isFromMedicalReport) { children: [
if (isForFeedback) { Expanded(
contactUsViewModel!.setPatientFeedbackSelectedAppointment(patientAppointmentHistoryResponseModel); flex: 6,
child: CustomButton(
text: LocaleKeys.askDoctor.tr(context: context),
onPressed: () async {
LoaderBottomSheet.showLoader(loadingText: LocaleKeys.checkingDoctorAvailability.tr(context: context));
await myAppointmentsViewModel.isDoctorAvailable(
projectID: patientAppointmentHistoryResponseModel.projectID,
doctorId: patientAppointmentHistoryResponseModel.doctorID,
clinicId: patientAppointmentHistoryResponseModel.clinicID,
onSuccess: (value) async {
if (value) {
await myAppointmentsViewModel.getAskDoctorRequestTypes(onSuccess: (val) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
context,
title: LocaleKeys.askDoctor.tr(context: context),
child: AskDoctorRequestTypeSelect(
askDoctorRequestTypeList: myAppointmentsViewModel.askDoctorRequestTypeList,
myAppointmentsViewModel: myAppointmentsViewModel,
patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel,
),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
});
} else {
print("Doctor is not available");
}
});
},
backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor,
fontSize: (isFoldable || isTablet) ? 12.f : 14.f,
fontWeight: FontWeight.w600,
borderRadius: 12.r,
padding: EdgeInsets.symmetric(horizontal: 10.w),
// height: isTablet || isFoldable ? 46.h : 40.h,
height: 40.h,
icon: AppAssets.ask_doctor_icon,
iconColor: AppColors.primaryRedColor,
iconSize: 16.h,
),
),
SizedBox(width: 8.h),
Expanded(
flex: 1,
child: Container(
height: (isFoldable || isTablet) ? 50.h : 40.h,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.textColor,
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,
width: 24.w,
height: 24.h,
fit: BoxFit.contain,
),
),
).toShimmer2(isShow: isLoading).onPress(() {
_goToDetails(context);
}),
),
],
);
} else {
return CustomButton(
text: isFromMedicalReport ? LocaleKeys.selectAppointment.tr(context: context) : LocaleKeys.viewDetails.tr(context: context),
onPressed: () {
if (isFromMedicalReport) {
if (isForFeedback) {
contactUsViewModel!.setPatientFeedbackSelectedAppointment(patientAppointmentHistoryResponseModel);
} else {
medicalFileViewModel!.setSelectedMedicalReportAppointment(patientAppointmentHistoryResponseModel);
}
Navigator.pop(context, false);
} else { } else {
medicalFileViewModel!.setSelectedMedicalReportAppointment(patientAppointmentHistoryResponseModel); Navigator.of(context)
.push(
CustomPageRoute(
page: AppointmentDetailsPage(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel),
),
)
.then((_) {
myAppointmentsViewModel.initAppointmentsViewModel();
myAppointmentsViewModel.getPatientAppointments(true, false);
});
} }
Navigator.pop(context, false); },
} else { backgroundColor: AppColors.secondaryLightRedColor,
Navigator.of(context) borderColor: AppColors.secondaryLightRedColor,
.push( textColor: AppColors.primaryRedColor,
CustomPageRoute( fontSize: (isFoldable || isTablet) ? 12.f : 14.f,
page: AppointmentDetailsPage(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel), fontWeight: FontWeight.w600,
), borderRadius: 12.r,
) padding: EdgeInsets.symmetric(horizontal: 10.w),
.then((_) { // height: isTablet || isFoldable ? 46.h : 40.h,
myAppointmentsViewModel.initAppointmentsViewModel(); height: 40.h,
myAppointmentsViewModel.getPatientAppointments(true, false); icon: isFromMedicalReport ? AppAssets.checkmark_icon : null,
}); iconColor: AppColors.primaryRedColor,
} iconSize: 16.h,
}, );
backgroundColor: AppColors.secondaryLightRedColor, }
borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor,
fontSize: (isFoldable || isTablet) ? 12.f : 14.f,
fontWeight: FontWeight.w600,
borderRadius: 12.r,
padding: EdgeInsets.symmetric(horizontal: 10.w),
// height: isTablet || isFoldable ? 46.h : 40.h,
height: 40.h,
icon: isFromMedicalReport ? AppAssets.checkmark_icon : null,
iconColor: AppColors.primaryRedColor,
iconSize: 16.h,
);
} else { } else {
if (isFromMedicalReport) { if (isFromMedicalReport) {
if (isForEyeMeasurements) { if (isForEyeMeasurements) {
@ -309,7 +390,6 @@ class AppointmentCard extends StatelessWidget {
); );
} }
} }
return Row( return Row(
children: [ children: [
Expanded( Expanded(

@ -215,8 +215,8 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget {
children: [ children: [
LocaleKeys.amountBeforeTax.tr(context: context).toText14(isBold: true), LocaleKeys.amountBeforeTax.tr(context: context).toText14(isBold: true),
Utils.getPaymentAmountWithSymbol((immediateLiveCareVM.liveCareImmediateAppointmentFeesList.amount ?? "").toText16(isBold: true, isEnglishOnly: true), AppColors.blackColor, 13, Utils.getPaymentAmountWithSymbol((immediateLiveCareVM.liveCareImmediateAppointmentFeesList.amount ?? "").toText16(isBold: true, isEnglishOnly: true), AppColors.blackColor, 13,
isSaudiCurrency: immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "sar" || isSaudiCurrency: (immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency ?? "sar").toLowerCase() == "sar" ||
immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "ريال"), (immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency ?? "ريال").toLowerCase() == "ريال"),
], ],
).paddingSymmetrical(24.h, 0.h), ).paddingSymmetrical(24.h, 0.h),
Row( Row(
@ -224,9 +224,9 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget {
children: [ children: [
LocaleKeys.vat15.tr(context: context).toText14(isBold: true, color: AppColors.greyTextColor), LocaleKeys.vat15.tr(context: context).toText14(isBold: true, color: AppColors.greyTextColor),
Utils.getPaymentAmountWithSymbol( Utils.getPaymentAmountWithSymbol(
immediateLiveCareVM.liveCareImmediateAppointmentFeesList.tax!.toText14(isBold: true, color: AppColors.greyTextColor, isEnglishOnly: true), AppColors.greyTextColor, 13, (immediateLiveCareVM.liveCareImmediateAppointmentFeesList.tax ?? "0.0").toText14(isBold: true, color: AppColors.greyTextColor, isEnglishOnly: true), AppColors.greyTextColor, 13,
isSaudiCurrency: (immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "sar" || isSaudiCurrency: ((immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency ?? "sar").toLowerCase() == "sar" ||
immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "ريال")), (immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency ?? "ريال").toLowerCase() == "ريال")),
], ],
).paddingSymmetrical(24.h, 0.h), ).paddingSymmetrical(24.h, 0.h),
SizedBox(height: 17.h), SizedBox(height: 17.h),
@ -234,9 +234,9 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
SizedBox(width: 200.h, child: Utils.getPaymentMethods()), SizedBox(width: 200.h, child: Utils.getPaymentMethods()),
Utils.getPaymentAmountWithSymbol(immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total!.toText24(isBold: true, isEnglishOnly: true), AppColors.blackColor, 17, Utils.getPaymentAmountWithSymbol((immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total ?? "0.0").toText24(isBold: true, isEnglishOnly: true), AppColors.blackColor, 17,
isSaudiCurrency: (immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "sar" || isSaudiCurrency: ((immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency ?? "sar").toLowerCase() == "sar" ||
immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "ريال")), (immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency ?? "ريال").toLowerCase() == "ريال")),
], ],
).paddingSymmetrical(24.h, 0.h), ).paddingSymmetrical(24.h, 0.h),
(immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total == "0" || immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total == "0.0") (immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total == "0" || immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total == "0.0")

@ -264,7 +264,7 @@ class _ImmediateLiveCarePaymentPageState extends State<ImmediateLiveCarePaymentP
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
LocaleKeys.amountBeforeTax.tr().toText14(isBold: true), LocaleKeys.amountBeforeTax.tr().toText14(isBold: true),
Utils.getPaymentAmountWithSymbol(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.amount!.toString().toText16(isBold: true), AppColors.blackColor, 13, Utils.getPaymentAmountWithSymbol((immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.amount ?? "0.0").toString().toText16(isBold: true), AppColors.blackColor, 13,
isSaudiCurrency: true), isSaudiCurrency: true),
], ],
).paddingSymmetrical(24.h, 0.h), ).paddingSymmetrical(24.h, 0.h),
@ -273,7 +273,7 @@ class _ImmediateLiveCarePaymentPageState extends State<ImmediateLiveCarePaymentP
children: [ children: [
LocaleKeys.vat15.tr().toText14(isBold: true, color: AppColors.greyTextColor), LocaleKeys.vat15.tr().toText14(isBold: true, color: AppColors.greyTextColor),
Utils.getPaymentAmountWithSymbol( Utils.getPaymentAmountWithSymbol(
immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.tax!.toString().toText14(isBold: true, color: AppColors.greyTextColor), AppColors.greyTextColor, 13, (immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.tax ?? "0.0").toString().toText14(isBold: true, color: AppColors.greyTextColor), AppColors.greyTextColor, 13,
isSaudiCurrency: true), isSaudiCurrency: true),
], ],
).paddingSymmetrical(24.h, 0.h), ).paddingSymmetrical(24.h, 0.h),
@ -282,7 +282,7 @@ class _ImmediateLiveCarePaymentPageState extends State<ImmediateLiveCarePaymentP
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
"".toText14(isBold: true), "".toText14(isBold: true),
Utils.getPaymentAmountWithSymbol(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total!.toString().toText24(isBold: true), AppColors.blackColor, 17, Utils.getPaymentAmountWithSymbol((immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total ?? "0.0").toString().toText24(isBold: true), AppColors.blackColor, 17,
isSaudiCurrency: true), isSaudiCurrency: true),
], ],
).paddingSymmetrical(24.h, 0.h), ).paddingSymmetrical(24.h, 0.h),
@ -466,7 +466,7 @@ class _ImmediateLiveCarePaymentPageState extends State<ImmediateLiveCarePaymentP
//TODO: Need to pass dynamic params to the payment request instead of static values //TODO: Need to pass dynamic params to the payment request instead of static values
browser?.openPaymentBrowser( browser?.openPaymentBrowser(
num.parse(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total!), num.parse(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total ?? "0.0"),
"LiveCare Payment", "LiveCare Payment",
transID, transID,
"12", "12",
@ -547,7 +547,7 @@ class _ImmediateLiveCarePaymentPageState extends State<ImmediateLiveCarePaymentP
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${appState.getAuthenticatedUser()!.patientId.toString()}@HMG.com", customerEmail: "CustID_${appState.getAuthenticatedUser()!.patientId.toString()}@HMG.com",
orderDescription: "LiveCare Payment", orderDescription: "LiveCare Payment",
orderAmount: double.parse(immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total!), orderAmount: double.parse((immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total ?? "0.0")),
merchantReference: transID, merchantReference: transID,
merchantIdentifier: payfortViewModel.payfortProjectDetailsRespModel!.merchantIdentifier, merchantIdentifier: payfortViewModel.payfortProjectDetailsRespModel!.merchantIdentifier,
applePayAccessCode: payfortViewModel.payfortProjectDetailsRespModel!.accessCode, applePayAccessCode: payfortViewModel.payfortProjectDetailsRespModel!.accessCode,

@ -17,6 +17,7 @@ import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/countdown_timer.dart'; import 'package:hmg_patient_app_new/widgets/countdown_timer.dart';
import 'package:lottie/lottie.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
@ -97,17 +98,28 @@ class _ImmediateLiveCarePendingRequestPageState extends State<ImmediateLiveCareP
SizedBox(width: 8.w), SizedBox(width: 8.w),
AppCustomChipWidget( AppCustomChipWidget(
icon: AppAssets.appointment_calendar_icon, icon: AppAssets.appointment_calendar_icon,
labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(immediateLiveCareViewModel.patientLiveCareHistoryList[0].arrivalTime), false)), labelText: DateUtil.formatDateToDate(
DateUtil.convertStringToDate(
immediateLiveCareViewModel.patientLiveCareHistoryList.isNotEmpty ? immediateLiveCareViewModel.patientLiveCareHistoryList[0].arrivalTime : ""),
false)),
], ],
), ),
Utils.buildSvgWithAssets(icon: AppAssets.waiting_icon, width: 24.h, height: 24.h), Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.greyColor,
borderRadius: 10.h,
hasShadow: false,
),
padding: EdgeInsets.all(6.h),
child: Lottie.asset(AppAnimations.hourGlass, repeat: true, reverse: false, frameRate: FrameRate(60), width: 40.h, height: 40.h, fit: BoxFit.fill)),
// Lottie.asset(AppAnimations.pending_loading_animation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 80.h, height: 80.h, fit: BoxFit.cover), // Lottie.asset(AppAnimations.pending_loading_animation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 80.h, height: 80.h, fit: BoxFit.cover),
], ],
), ),
SizedBox(height: 8.h), SizedBox(height: 8.h),
SizedBox(height: 8.h), SizedBox(height: 8.h),
LocaleKeys.yourTurnIsAfterPatients LocaleKeys.yourTurnIsAfterPatients.tr(namedArgs: {
.tr(namedArgs: {'count': (immediateLiveCareViewModel.patientLiveCareHistoryList[0].patCount ?? 0).toString()}, context: context).toText14(isBold: true), 'count': (immediateLiveCareViewModel.patientLiveCareHistoryList.isNotEmpty ? immediateLiveCareViewModel.patientLiveCareHistoryList[0].patCount ?? 0 : 0).toString()
}, context: context).toText14(isBold: true),
// "Your turn is after ${immediateLiveCareViewModel.patientLiveCareHistoryList[0].patCount} patients.".toText16(isBold: true), // "Your turn is after ${immediateLiveCareViewModel.patientLiveCareHistoryList[0].patCount} patients.".toText16(isBold: true),
SizedBox(height: 8.h), SizedBox(height: 8.h),
], ],
@ -127,7 +139,7 @@ class _ImmediateLiveCarePendingRequestPageState extends State<ImmediateLiveCareP
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Expected waiting time: ".toText16(isBold: true), LocaleKeys.waitingTime.tr(context: context).toText16(isBold: true),
SizedBox(height: 8.h), SizedBox(height: 8.h),
ValueListenableBuilder<Duration>( ValueListenableBuilder<Duration>(
valueListenable: immediateLiveCareVM.durationNotifier, valueListenable: immediateLiveCareVM.durationNotifier,

@ -1079,7 +1079,8 @@ class _SelectClinicPageState extends State<SelectClinicPage> {
// } // }
var bottomSheetType = RegionBottomSheetType.FOR_CLINIIC; var bottomSheetType = RegionBottomSheetType.FOR_CLINIIC;
if (clinic.clinicID == 17) { if (clinic.clinicID == 17) {
regionalViewModel.setBottomSheetState(AppointmentViaRegionState.HOSPITAL_SELECTION); // regionalViewModel.setBottomSheetState(AppointmentViaRegionState.HOSPITAL_SELECTION);
// bottomSheetType = RegionBottomSheetType.REGION_FOR_DENTAL_AND_LASER;
bottomSheetType = RegionBottomSheetType.REGION_FOR_DENTAL_AND_LASER; bottomSheetType = RegionBottomSheetType.REGION_FOR_DENTAL_AND_LASER;
} }
// if (clinic.clinicID == 253) { // if (clinic.clinicID == 253) {

@ -74,7 +74,8 @@ class _HabibWalletState extends State<HabibWalletPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"${_appState.getAuthenticatedUser()!.firstName!} ${_appState.getAuthenticatedUser()!.lastName!}".toText19(isBold: true, color: Colors.white), "${_appState.getAuthenticatedUser()!.firstName!} ${_appState.getAuthenticatedUser()!.lastName!}".toText19(isBold: true, color: Colors.white),
"MRN: ${_appState.getAuthenticatedUser()!.patientId!}".toText14(isBold: true, color: AppColors.greyTextColor, isEnglishOnly: true), "${LocaleKeys.fileno.tr(context: context)}: ${_appState.getAuthenticatedUser()!.patientId!}"
.toText14(isBold: true, color: AppColors.greyTextColor, isEnglishOnly: true),
], ],
).expanded, ).expanded,
Utils.buildSvgWithAssets(icon: AppAssets.habiblogo, width: 24.h, height: 24.h, applyThemeColor: false), Utils.buildSvgWithAssets(icon: AppAssets.habiblogo, width: 24.h, height: 24.h, applyThemeColor: false),
@ -84,8 +85,15 @@ class _HabibWalletState extends State<HabibWalletPage> {
LocaleKeys.balanceAmount.tr(context: context).toText14(isBold: true, color: Colors.white), LocaleKeys.balanceAmount.tr(context: context).toText14(isBold: true, color: Colors.white),
SizedBox(height: 4.h), SizedBox(height: 4.h),
Consumer<HabibWalletViewModel>(builder: (context, habibWalletVM, child) { Consumer<HabibWalletViewModel>(builder: (context, habibWalletVM, child) {
return Utils.getPaymentAmountWithSymbol2(num.parse(NumberFormat.decimalPattern().format(habibWalletVM.habibWalletAmount)), return Utils.getPaymentAmountWithSymbol2(
textColor: Colors.white, iconColor: Colors.white, iconSize: 16, isExpanded: false) num.parse(
NumberFormat.decimalPattern().format(habibWalletVM.habibWalletAmount),
),
textColor: Colors.white,
iconColor: Colors.white,
iconSize: 16,
isExpanded: false,
letterSpacing: -1)
.toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.h, width: 80.h, height: 24.h); .toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.h, width: 80.h, height: 24.h);
}), }),
], ],
@ -140,7 +148,7 @@ class _HabibWalletState extends State<HabibWalletPage> {
children: [ children: [
Expanded(child: habibWalletVM.habibWalletBalanceList[index].projectDescription!.toText16(isBold: true, color: AppColors.textColor)), Expanded(child: habibWalletVM.habibWalletBalanceList[index].projectDescription!.toText16(isBold: true, color: AppColors.textColor)),
Utils.getPaymentAmountWithSymbol2(num.parse(NumberFormat.decimalPattern().format(habibWalletVM.habibWalletBalanceList[index].patientAdvanceBalanceAmount!)), Utils.getPaymentAmountWithSymbol2(num.parse(NumberFormat.decimalPattern().format(habibWalletVM.habibWalletBalanceList[index].patientAdvanceBalanceAmount!)),
textColor: AppColors.textColor, iconColor: AppColors.textColor, iconSize: 18.h, isExpanded: false, fontSize: 28.f, fontWeight: FontWeight.w600,), textColor: AppColors.textColor, iconColor: AppColors.textColor, iconSize: 18.h, isExpanded: false, fontSize: 28.f, fontWeight: FontWeight.w600, letterSpacing: -1),
], ],
).paddingSymmetrical(0, 12.h); ).paddingSymmetrical(0, 12.h);
}, },

@ -69,6 +69,7 @@ import 'package:hmg_patient_app_new/widgets/countdown_timer.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart'; import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:hmg_patient_app_new/widgets/routes/spring_page_route_builder.dart'; import 'package:hmg_patient_app_new/widgets/routes/spring_page_route_builder.dart';
import 'package:lottie/lottie.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:smooth_corner/smooth_corner.dart'; import 'package:smooth_corner/smooth_corner.dart';
@ -483,29 +484,37 @@ class _LandingPageState extends State<LandingPage> {
) )
: SizedBox( : SizedBox(
height: 255.h + 20 + 30, // itemHeight + shadow padding (10 top + 10 bottom) + pagination dots space height: 255.h + 20 + 30, // itemHeight + shadow padding (10 top + 10 bottom) + pagination dots space
child: Swiper( child: Builder(
itemCount: myAppointmentsVM.isMyAppointmentsLoading builder: (context) {
? 3 final int swiperItemCount = myAppointmentsVM.isMyAppointmentsLoading
: myAppointmentsVM.patientAppointmentsHistoryList.length < 3 ? 3
? myAppointmentsVM.patientAppointmentsHistoryList.length : myAppointmentsVM.patientAppointmentsHistoryList.length < 3
: 3, ? myAppointmentsVM.patientAppointmentsHistoryList.length
layout: SwiperLayout.STACK, : 3;
loop: false, final bool isArabic = appState.isArabic();
itemWidth: MediaQuery.of(context).size.width - 48.h, return Swiper(
indicatorLayout: PageIndicatorLayout.COLOR, itemCount: swiperItemCount,
axisDirection: appState.isArabic() ? AxisDirection.right : AxisDirection.left, layout: SwiperLayout.STACK,
controller: _controller, loop: false,
itemHeight: 255.h + 20, itemWidth: MediaQuery.of(context).size.width - 48.h,
// extra space for shadow indicatorLayout: PageIndicatorLayout.COLOR,
pagination: SwiperPagination( axisDirection: isArabic ? AxisDirection.right : AxisDirection.left,
alignment: Alignment.bottomCenter, controller: _controller,
margin: EdgeInsets.only(top: 220.h + 20 + 8 + 24), index: isArabic ? swiperItemCount - 1 : 0,
builder: DotSwiperPaginationBuilder(color: Color(0xffD9D9D9), activeColor: AppColors.blackBgColor), itemHeight: 255.h + 20,
), // extra space for shadow
itemBuilder: (BuildContext context, int index) { pagination: SwiperPagination(
return Padding( alignment: Alignment.bottomCenter,
padding: const EdgeInsets.symmetric(vertical: 10), margin: EdgeInsets.only(top: 220.h + 20 + 8 + 24),
child: getIndexSwiperCard(index), builder: DotSwiperPaginationBuilder(color: Color(0xffD9D9D9), activeColor: AppColors.blackBgColor),
),
itemBuilder: (BuildContext context, int index) {
final int actualIndex = isArabic ? (swiperItemCount - 1 - index) : index;
return Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: getIndexSwiperCard(actualIndex),
);
},
); );
}, },
), ),
@ -1148,6 +1157,7 @@ class _LandingPageState extends State<LandingPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppCustomChipWidget( AppCustomChipWidget(
labelText: liveCareData.stringCallStatus, labelText: liveCareData.stringCallStatus,
@ -1162,13 +1172,42 @@ class _LandingPageState extends State<LandingPage> {
false, false,
), ),
), ),
SizedBox(width: 8.w),
AppCustomChipWidget(
richText: ValueListenableBuilder<Duration>(
valueListenable: immediateLiveCareViewModel.durationNotifier,
builder: (context, duration, child) {
final hours = duration.inHours.toString().padLeft(2, '0');
final minutes = duration.inMinutes.remainder(60).toString().padLeft(2, '0');
final seconds = duration.inSeconds.remainder(60).toString().padLeft(2, '0');
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
'$hours:$minutes:$seconds'.toText10(isBold: true),
],
);
},
),
// labelText: DateUtil.formatDateToDate(
// DateUtil.convertStringToDate(liveCareData.arrivalTime),
// false,
// ),
),
], ],
), ),
Utils.buildSvgWithAssets( Container(
icon: AppAssets.waiting_icon, decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
width: 24.h, color: AppColors.greyColor,
height: 24.h, borderRadius: 10.h,
), hasShadow: false,
),
padding: EdgeInsets.all(6.h),
child: Lottie.asset(AppAnimations.hourGlass, repeat: true, reverse: false, frameRate: FrameRate(60), width: 40.h, height: 40.h, fit: BoxFit.fill)),
// Utils.buildSvgWithAssets(
// icon: AppAssets.waiting_icon,
// width: 24.h,
// height: 24.h,
// ),
], ],
); );
} }

@ -1,6 +1,8 @@
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; 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';
@ -76,13 +78,14 @@ class HabibWalletCard extends StatelessWidget {
// ], // ],
// ), // ),
SizedBox(height: 4.h), SizedBox(height: 4.h),
Row( Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Column( Consumer<HabibWalletViewModel>(builder: (context, habibWalletVM, child) {
crossAxisAlignment: CrossAxisAlignment.start, return Row(
children: [ mainAxisSize: MainAxisSize.max,
Consumer<HabibWalletViewModel>(builder: (context, habibWalletVM, child) { children: [
return Row( Row(
children: [ children: [
Utils.buildSvgWithAssets( Utils.buildSvgWithAssets(
icon: AppAssets.saudi_riyal_icon, icon: AppAssets.saudi_riyal_icon,
@ -98,58 +101,70 @@ class HabibWalletCard extends StatelessWidget {
.toText32(isBold: true, isEnglishOnly: true) .toText32(isBold: true, isEnglishOnly: true)
.toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.h, width: 80.h, height: 40.h), .toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.h, width: 80.h, height: 40.h),
], ],
); ),
}), Spacer(),
Padding( Utils.getPaymentMethods(),
padding: EdgeInsets.symmetric(horizontal: 35.h), ],
child: Row( );
children: [ }),
LocaleKeys.viewDetails.tr(context: context).toText12(color: AppColors.primaryRedColor, isBold: true),
Icon(Icons.arrow_forward_ios, color: AppColors.primaryRedColor, size: 10.h),
],
).onPress(() {
Navigator.of(context).push(
CustomPageRoute(
page: HabibWalletPage(),
),
);
}),
),
],
),
SizedBox(
// width: 50.h,
child: Utils.getPaymentMethods(),
),
], ],
), ),
SizedBox(height: 16.h), SizedBox(height: 16.h),
CustomButton( Row(
height: 40.h, children: [
icon: AppAssets.recharge_icon, Expanded(
iconColor: AppColors.infoColor, flex: 6,
iconSize: 24.h, child: CustomButton(
backgroundColor: AppColors.infoColor.withAlpha(15), height: 40.h,
textColor: AppColors.infoColor, icon: AppAssets.recharge_icon,
text: LocaleKeys.recharge.tr(context: context), iconColor: AppColors.infoColor,
borderWidth: 0.w, iconSize: 24.h,
fontWeight: FontWeight.w600, backgroundColor: AppColors.infoColor.withAlpha(15),
borderColor: AppColors.infoColor.withAlpha(15), textColor: AppColors.infoColor,
padding: EdgeInsets.fromLTRB(4, 0, 12, 0), text: LocaleKeys.recharge.tr(context: context),
fontSize: 14.f, borderWidth: 0.w,
onPressed: () { fontWeight: FontWeight.w600,
Navigator.of(context).push(CustomPageRoute(page: RechargeWalletPage())); borderColor: AppColors.infoColor.withAlpha(15),
}, padding: EdgeInsets.fromLTRB(4, 0, 12, 0),
fontSize: 14.f,
onPressed: () {
Navigator.of(context).push(CustomPageRoute(page: RechargeWalletPage()));
},
),
),
SizedBox(width: 8.h),
Expanded(
flex: 1,
child: Container(
height: (isFoldable || isTablet) ? 50.h : 40.h,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.textColor,
borderRadius: 10.h,
side: BorderSide(
color: AppColors.textColor,
width: 1.2,
),
),
child: Transform.flip(
flipX: getIt.get<AppState>().isArabic(),
child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon,
iconColor: AppColors.whiteColor,
width: 24.w,
height: 24.h,
fit: BoxFit.contain,
),
),
).onPress(() {
Navigator.of(context).push(
CustomPageRoute(
page: HabibWalletPage(),
),
);
}),
),
],
), ),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// SizedBox(
// width: 200.h,
// child: Utils.getPaymentMethods(),
// ),
// ],
// ),
], ],
), ),
), ),

@ -26,8 +26,7 @@ class AppTheme {
canvasColor: Colors.white, canvasColor: Colors.white,
highlightColor: Colors.grey[100]!.withOpacity(0.4), highlightColor: Colors.grey[100]!.withOpacity(0.4),
splashColor: Colors.transparent, splashColor: Colors.transparent,
bottomSheetTheme: BottomSheetThemeData( bottomSheetTheme: BottomSheetThemeData(backgroundColor: Colors.black.withOpacity(0)),
backgroundColor: Colors.black.withOpacity(0)),
floatingActionButtonTheme: const FloatingActionButtonThemeData(highlightElevation: 2, disabledElevation: 0, elevation: 2), floatingActionButtonTheme: const FloatingActionButtonThemeData(highlightElevation: 2, disabledElevation: 0, elevation: 2),
appBarTheme: AppBarTheme( appBarTheme: AppBarTheme(
color: const Color(0xff515A5D), color: const Color(0xff515A5D),
@ -35,7 +34,7 @@ class AppTheme {
actionsIconTheme: IconThemeData( actionsIconTheme: IconThemeData(
color: Colors.grey[800], color: Colors.grey[800],
), ),
systemOverlayStyle: SystemUiOverlayStyle.light, systemOverlayStyle: SystemUiOverlayStyle.dark,
surfaceTintColor: Colors.transparent, surfaceTintColor: Colors.transparent,
), ),
); );

@ -88,7 +88,7 @@ Widget buildDigit(String digit) {
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
fontSize: 14.f, fontSize: 10.f,
), ),
), ),
), ),

@ -210,7 +210,7 @@ class _GMSMapState extends State<GMSMap> {
Icons.location_pin, Icons.location_pin,
size: 36.h, size: 36.h,
color: AppColors.primaryRedColor, color: AppColors.primaryRedColor,
).paddingOnly(bottom: Platform.isAndroid ? 30.h : double.parse((widget.bottomPaddingHeight + 25.h).toString())), ).paddingOnly(bottom: Platform.isAndroid ? 30.h : 60.h),
), ),
// My Location button // My Location button

@ -204,44 +204,22 @@ abstract class _CustomLayoutStateBase<T extends _SubSwiper> extends State<T>
void _onPanEnd(DragEndDetails details) { void _onPanEnd(DragEndDetails details) {
if (_lockScroll) return; if (_lockScroll) return;
final bool _isReversedGesture = widget.axisDirection == AxisDirection.right;
double velocity = widget.scrollDirection == Axis.horizontal double velocity = widget.scrollDirection == Axis.horizontal
? details.velocity.pixelsPerSecond.dx ? details.velocity.pixelsPerSecond.dx
: details.velocity.pixelsPerSecond.dy; : details.velocity.pixelsPerSecond.dy;
if (_isReversedGesture) { if (_animationController.value >= 0.75 || velocity > 500.0) {
// Reversed: swipe right (value >= 0.75) = next, swipe left (value < 0.25) = previous if (_currentIndex <= 0 && !widget.loop) {
if (_animationController.value >= 0.75 || velocity > 500.0) { return;
if (_currentIndex >= widget.itemCount - 1 && !widget.loop) {
_move(0.5);
return;
}
_move(1.0, nextIndex: _currentIndex + 1);
} else if (_animationController.value < 0.25 || velocity < -500.0) {
if (_currentIndex <= 0 && !widget.loop) {
_move(0.5);
return;
}
_move(0.0, nextIndex: _currentIndex - 1);
} else {
_move(0.5);
} }
} else { _move(1.0, nextIndex: _currentIndex - 1);
// Default: swipe right (value >= 0.75) = previous, swipe left (value < 0.25) = next } else if (_animationController.value < 0.25 || velocity < -500.0) {
if (_animationController.value >= 0.75 || velocity > 500.0) { if (_currentIndex >= widget.itemCount - 1 && !widget.loop) {
if (_currentIndex <= 0 && !widget.loop) { return;
return;
}
_move(1.0, nextIndex: _currentIndex - 1);
} else if (_animationController.value < 0.25 || velocity < -500.0) {
if (_currentIndex >= widget.itemCount - 1 && !widget.loop) {
return;
}
_move(0.0, nextIndex: _currentIndex + 1);
} else {
_move(0.5);
} }
_move(0.0, nextIndex: _currentIndex + 1);
} else {
_move(0.5);
} }
} }
@ -255,7 +233,6 @@ abstract class _CustomLayoutStateBase<T extends _SubSwiper> extends State<T>
void _onPanUpdate(DragUpdateDetails details) { void _onPanUpdate(DragUpdateDetails details) {
if (_lockScroll) return; if (_lockScroll) return;
double value = _currentValue + double value = _currentValue +
((widget.scrollDirection == Axis.horizontal ((widget.scrollDirection == Axis.horizontal
? details.globalPosition.dx ? details.globalPosition.dx
@ -265,26 +242,13 @@ abstract class _CustomLayoutStateBase<T extends _SubSwiper> extends State<T>
2; 2;
// no loop ? // no loop ?
if (!widget.loop) { if (!widget.loop) {
if (widget.axisDirection == AxisDirection.right) { if (_currentIndex >= widget.itemCount - 1) {
// Reversed bounds: block dragging left past first, right past last if (value < 0.5) {
if (_currentIndex <= 0) { value = 0.5;
if (value < 0.5) {
value = 0.5;
}
} else if (_currentIndex >= widget.itemCount - 1) {
if (value > 0.5) {
value = 0.5;
}
} }
} else { } else if (_currentIndex <= 0) {
if (_currentIndex >= widget.itemCount - 1) { if (value > 0.5) {
if (value < 0.5) { value = 0.5;
value = 0.5;
}
} else if (_currentIndex <= 0) {
if (value > 0.5) {
value = 0.5;
}
} }
} }
} }

Loading…
Cancel
Save