diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 24f046dd..b066ce0f 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -2066,11 +2066,11 @@ "notificationPermissionText": "إذن الإشعارات", "testLiveCareConnection": "اختبار اتصال لايف كير", "cameraFeedInactive": "بث الكاميرا غير نشط", - "cantWaitLiveCare": "معاودة الاتصال بي, لا أستطيع الانتظار”", "whenCallBackLiveCare": "متى تود أن نعاود الاتصال بك؟", "after30Mins": "اتصل بي بعد 30 دقيقة", "after30MinsDesc": "سيتصل بك الطبيب بعد 30 دقيقة.", "after1Hour": "اتصل بي بعد ساعة", - "after1HourDesc": "سيتصل بك الطبيب بعد ساعة واحدة." + "after1HourDesc": "سيتصل بك الطبيب بعد ساعة واحدة.", + "backToHome": "العودة للصفحة الرئيسية" } diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 693b31f5..ce8d6ad4 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -2056,13 +2056,13 @@ "notificationPermissionText": "Notifications Permission", "testLiveCareConnection": "Test LiveCare Connection", "cameraFeedInactive": "Camera feed inactive", - "cantWaitLiveCare": "I can't wait, Please call me later", "whenCallBackLiveCare": "When would you like to be called back?", "after30Mins": "After 30 Mins", "after30MinsDesc": "You will be called by the doctor after 30 mins", "after1Hour": "After 1 Hour", - "after1HourDesc": "You will be called by the doctor after 1 hour" + "after1HourDesc": "You will be called by the doctor after 1 hour", + "backToHome": "Back To Home" } diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index e4f43aaa..85cd7b37 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -1023,7 +1023,7 @@ const DOWNLOAD_PHARMACY_INVOICE_PDF = 'Services/Notifications.svc/REST/DownloadI const GET_APPOINTMENT_PARKING_QR = 'Services/outps.svc/rest/pms_getParkingTicketByAppointmentNo'; -const RESCHEDULE_LIVECARE_CALL = 'Services/ER_VirtualCall.svc/ArrangeCall'; +const RESCHEDULE_LIVECARE_CALL = 'Services/ER_VirtualCall.svc/REST/ArrangeCall'; class ApiKeyConstants { static final String googleMapsApiKey = 'AIzaSyB6TERnxIr0yJ3qG4ULBZbu0sAD4tGqtng'; diff --git a/lib/features/immediate_livecare/immediate_livecare_view_model.dart b/lib/features/immediate_livecare/immediate_livecare_view_model.dart index df123a8d..8a27b3c4 100644 --- a/lib/features/immediate_livecare/immediate_livecare_view_model.dart +++ b/lib/features/immediate_livecare/immediate_livecare_view_model.dart @@ -64,6 +64,7 @@ class ImmediateLiveCareViewModel extends ChangeNotifier { bool isTermsAccepted = false; int selectedRescheduleTime = 0; //1 => 30 mins, 2 => 60 mins + bool isLiveCareHistoryLoading = false; initImmediateLiveCare() { _appState = getIt(); @@ -104,6 +105,11 @@ class ImmediateLiveCareViewModel extends ChangeNotifier { notifyListeners(); } + setIsLiveCareHistoryLoading(bool val) { + isLiveCareHistoryLoading = val; + notifyListeners(); + } + Future getLiveCareImmediateClinicsList({Function(dynamic)? onSuccess, Function(String)? onError}) async { immediateLiveCareClinicsList.clear(); isImmediateLiveCareClinicsLoading = true; @@ -300,14 +306,18 @@ class ImmediateLiveCareViewModel extends ChangeNotifier { Future getPatientLiveCareHistory({Function(dynamic)? onSuccess, Function(String)? onError}) async { patientLiveCareHistoryList = []; + patientLiveCareHistoryList.clear(); patientHasPendingLiveCareRequest = false; timer?.cancel(); + isLiveCareHistoryLoading = true; notifyListeners(); final result = await immediateLiveCareRepo.getPatientLiveCareHistory(); result.fold( (failure) async { + isLiveCareHistoryLoading = false; + notifyListeners(); if (onError != null) { onError(failure.message); } @@ -337,6 +347,7 @@ class ImmediateLiveCareViewModel extends ChangeNotifier { patientHasPendingLiveCareRequest = false; stopTimer(); // Stop timer if no history } + isLiveCareHistoryLoading = false; notifyListeners(); if (onSuccess != null) { onSuccess(apiResponse); diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 68601822..d4ead897 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -2052,5 +2052,6 @@ abstract class LocaleKeys { static const after30MinsDesc = 'after30MinsDesc'; static const after1Hour = 'after1Hour'; static const after1HourDesc = 'after1HourDesc'; + static const backToHome = 'backToHome'; } diff --git a/lib/presentation/book_appointment/livecare/immediate_livecare_pending_request_page.dart b/lib/presentation/book_appointment/livecare/immediate_livecare_pending_request_page.dart index 5ffaf516..e6ea2010 100644 --- a/lib/presentation/book_appointment/livecare/immediate_livecare_pending_request_page.dart +++ b/lib/presentation/book_appointment/livecare/immediate_livecare_pending_request_page.dart @@ -34,7 +34,7 @@ class ImmediateLiveCarePendingRequestPage extends StatefulWidget { } class _ImmediateLiveCarePendingRequestPageState extends State { - late ImmediateLiveCareViewModel immediateLiveCareViewModel; + // late ImmediateLiveCareViewModel immediateLiveCareViewModel; late AppState appState; String chatURL = ""; @@ -83,7 +83,7 @@ class _ImmediateLiveCarePendingRequestPageState extends State(context, listen: false); + // immediateLiveCareViewModel = Provider.of(context, listen: false); appState = getIt.get(); return Scaffold( backgroundColor: AppColors.bgScaffoldColor, @@ -118,7 +118,7 @@ class _ImmediateLiveCarePendingRequestPageState extends State