diff --git a/assets/images/svg/online_checkin_icon.svg b/assets/images/svg/online_checkin_icon.svg
new file mode 100644
index 00000000..4f21533f
--- /dev/null
+++ b/assets/images/svg/online_checkin_icon.svg
@@ -0,0 +1,5 @@
+
diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json
index b0d67521..4ac9878c 100644
--- a/assets/langs/ar-SA.json
+++ b/assets/langs/ar-SA.json
@@ -1708,5 +1708,6 @@
"profilePicture": "صورة الملف الشخصي",
"aiDisclaimerRad": "سيتم مشاركة بيانات نتائج الأشعة الخاصة بك بشكل آمن مع محلل الذكاء الاصطناعي لدينا لتحليلها. يساعد هذا في توفير رؤى صحية مخصصة. هل ترغب في المتابعة؟",
"sendingAskDrRequest": "جارٍ إرسال الطلب...",
- "askDrRequestSentSuccess": "تم إرسال الطلب بنجاح، وسيتواصل معك الطبيب قريباً."
+ "askDrRequestSentSuccess": "تم إرسال الطلب بنجاح، وسيتواصل معك الطبيب قريباً.",
+ "onlineCheckIn24HoursOnly": "لا تتوفر خدمة تسجيل الوصول عبر الإنترنت إلا خلال 4 ساعات من موعد الحجز.لا تتوفر خدمة تسجيل الوصول عبر الإنترنت إلا خلال 4 ساعات من موعد الحجز."
}
diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json
index 38ce9662..84d51a6c 100644
--- a/assets/langs/en-US.json
+++ b/assets/langs/en-US.json
@@ -1700,5 +1700,6 @@
"profilePicture": "Profile Picture",
"aiDisclaimerRad": "Your radiology result data will be securely shared with our AI Analyzer for analysis. This helps provide personalized health insights. Do you want to proceed?",
"sendingAskDrRequest": "Sending Request...",
- "askDrRequestSentSuccess": "Request has been sent successfully, The doctor will get back to you soon."
+ "askDrRequestSentSuccess": "Request has been sent successfully, The doctor will get back to you soon.",
+ "onlineCheckIn24HoursOnly": "Online Check-In is only available within 4 hours of the appointment time."
}
diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart
index 2b5abbe9..bf9144fa 100644
--- a/lib/core/api_consts.dart
+++ b/lib/core/api_consts.dart
@@ -4,7 +4,7 @@ import 'package:hmg_patient_app_new/core/enums.dart';
class ApiConsts {
static const maxSmallScreen = 660;
- static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.preProd;
+ static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod;
// static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT
diff --git a/lib/core/app_assets.dart b/lib/core/app_assets.dart
index 5adc0cd5..8c57598e 100644
--- a/lib/core/app_assets.dart
+++ b/lib/core/app_assets.dart
@@ -361,6 +361,7 @@ class AppAssets {
static const String open_camera = '$svgBasePath/open_camera.svg';
static const String gallery = '$svgBasePath/gallery.svg';
static const String files = '$svgBasePath/files.svg';
+ static const String online_checkin_icon = '$svgBasePath/online_checkin_icon.svg';
// PNGS //
static const String hmgLogo = '$pngBasePath/hmg_logo.png';
diff --git a/lib/core/utils/utils.dart b/lib/core/utils/utils.dart
index feca055a..ac7af39d 100644
--- a/lib/core/utils/utils.dart
+++ b/lib/core/utils/utils.dart
@@ -404,6 +404,85 @@ class Utils {
).center;
}
+ static Widget getOnlineCheckInWidget({
+ String? loadingText,
+ bool isShowActionButtons = false,
+ bool showOkButton = false,
+ Widget? bodyWidget,
+ Function? onConfirmTap,
+ Function? onCancelTap,
+ String? cancelText,
+ String? confirmText,
+ }) {
+ return Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Utils.buildSvgWithAssets(icon: AppAssets.online_checkin_icon, width: 80.h, height: 80.h, applyThemeColor: false),
+ SizedBox(height: 16.h),
+ (loadingText ?? LocaleKeys.loadingText.tr()).toText16(color: AppColors.blackColor, letterSpacing: 0, weight: FontWeight.w600),
+ SizedBox(height: 16.h),
+ bodyWidget ?? SizedBox.shrink(),
+ SizedBox(height: 16.h),
+ isShowActionButtons
+ ? Row(
+ children: [
+ Expanded(
+ child: CustomButton(
+ text: cancelText ?? LocaleKeys.cancel.tr(),
+ onPressed: () {
+ if (onCancelTap != null) {
+ onCancelTap();
+ }
+ },
+ backgroundColor: AppColors.primaryRedColor,
+ borderColor: AppColors.primaryRedColor,
+ textColor: AppColors.whiteColor,
+ // icon: AppAssets.cancel,
+ // iconColor: AppColors.whiteColor,
+ ),
+ ),
+ SizedBox(width: 8.h),
+ Expanded(
+ child: CustomButton(
+ text: confirmText ?? LocaleKeys.confirm.tr(),
+ onPressed: () async {
+ if (onConfirmTap != null) {
+ onConfirmTap();
+ }
+ },
+ backgroundColor: AppColors.bgGreenColor,
+ borderColor: AppColors.bgGreenColor,
+ textColor: Colors.white,
+ // icon: AppAssets.confirm,
+ ),
+ ),
+ ],
+ )
+ : showOkButton
+ ? Row(
+ children: [
+ Expanded(
+ child: CustomButton(
+ text: LocaleKeys.ok.tr(),
+ onPressed: () async {
+ if (onConfirmTap != null) {
+ onConfirmTap();
+ }
+ },
+ backgroundColor: AppColors.bgGreenColor,
+ borderColor: AppColors.bgGreenColor,
+ textColor: Colors.white,
+ // icon: AppAssets.confirm,
+ ),
+ ),
+ ],
+ )
+ : SizedBox.shrink(),
+ ],
+ ).center;
+ }
+
static Widget getWarningWidget({
String? loadingText,
bool isShowActionButtons = false,
diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart
index 2c0d5194..1e9b1349 100644
--- a/lib/generated/locale_keys.g.dart
+++ b/lib/generated/locale_keys.g.dart
@@ -1699,5 +1699,6 @@ abstract class LocaleKeys {
static const profilePicture = 'profilePicture';
static const sendingAskDrRequest = 'sendingAskDrRequest';
static const askDrRequestSentSuccess = 'askDrRequestSentSuccess';
+ static const onlineCheckIn24HoursOnly = 'onlineCheckIn24HoursOnly';
}
diff --git a/lib/presentation/appointments/appointment_details_page.dart b/lib/presentation/appointments/appointment_details_page.dart
index c668ebff..c0b469b4 100644
--- a/lib/presentation/appointments/appointment_details_page.dart
+++ b/lib/presentation/appointments/appointment_details_page.dart
@@ -72,6 +72,8 @@ class _AppointmentDetailsPageState extends State {
String mapURL = "";
+ bool isAppointmentWithin4Hours = false;
+
@override
void initState() {
scheduleMicrotask(() async {
@@ -81,8 +83,14 @@ class _AppointmentDetailsPageState extends State {
clinicID: widget.patientAppointmentHistoryResponseModel.clinicID,
projectID: widget.patientAppointmentHistoryResponseModel.projectID,
appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo);
+ } else {
+ Duration difference = DateUtil.convertStringToDate(widget.patientAppointmentHistoryResponseModel.appointmentDate).difference(DateTime.now());
+ if (difference.inMinutes > 240) {
+ isAppointmentWithin4Hours = false;
+ } else {
+ isAppointmentWithin4Hours = true;
+ }
}
-
});
super.initState();
}
@@ -1127,10 +1135,14 @@ class _AppointmentDetailsPageState extends State {
case 90:
showCommonBottomSheetWithoutHeight(context,
title: LocaleKeys.onlineCheckIn.tr(context: context),
- child: AppointmentCheckinBottomSheet(
- patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel,
- myAppointmentsViewModel: myAppointmentsViewModel,
- ),
+ child: isAppointmentWithin4Hours
+ ? AppointmentCheckinBottomSheet(
+ patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel,
+ myAppointmentsViewModel: myAppointmentsViewModel,
+ )
+ : Utils.getOnlineCheckInWidget(
+ loadingText: LocaleKeys.onlineCheckIn24HoursOnly.tr(context: context),
+ ),
callBackFunc: () {},
isFullScreen: false);
default:
diff --git a/lib/presentation/appointments/widgets/appointment_card.dart b/lib/presentation/appointments/widgets/appointment_card.dart
index 0542f76d..db08c923 100644
--- a/lib/presentation/appointments/widgets/appointment_card.dart
+++ b/lib/presentation/appointments/widgets/appointment_card.dart
@@ -40,6 +40,7 @@ class AppointmentCard extends StatelessWidget {
final ContactUsViewModel? contactUsViewModel;
final BookAppointmentsViewModel bookAppointmentsViewModel;
final bool isForRate;
+ // bool isAppointmentWithin4Hours = false;
const AppointmentCard(
{super.key,