|
|
|
@ -2,6 +2,7 @@ import 'dart:async';
|
|
|
|
|
|
|
|
|
|
|
|
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:get_it/get_it.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/location_util.dart';
|
|
|
|
import 'package:hmg_patient_app_new/core/location_util.dart';
|
|
|
|
@ -11,6 +12,7 @@ import 'package:hmg_patient_app_new/core/utils/loading_utils.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';
|
|
|
|
|
|
|
|
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
|
|
|
|
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_repo.dart';
|
|
|
|
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_repo.dart';
|
|
|
|
import 'package:hmg_patient_app_new/features/book_appointments/models/LaserCategoryType.dart';
|
|
|
|
import 'package:hmg_patient_app_new/features/book_appointments/models/LaserCategoryType.dart';
|
|
|
|
import 'package:hmg_patient_app_new/features/book_appointments/models/free_slot.dart';
|
|
|
|
import 'package:hmg_patient_app_new/features/book_appointments/models/free_slot.dart';
|
|
|
|
@ -879,30 +881,35 @@ class BookAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
await cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel).then((val) async {
|
|
|
|
await cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel).then((val) async {
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
// LoaderBottomSheet.hideLoader();
|
|
|
|
Future.delayed(Duration(milliseconds: 50)).then((value) async {});
|
|
|
|
Future.delayed(Duration(milliseconds: 50)).then((value) async {});
|
|
|
|
LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: LocaleKeys.bookingYourAppointment.tr());
|
|
|
|
// LoaderBottomSheet.showLoader(loadingText: LocaleKeys.bookingYourAppointment.tr());
|
|
|
|
await insertSpecificAppointment(
|
|
|
|
await insertSpecificAppointment(
|
|
|
|
onError: (err) {},
|
|
|
|
onError: (err) {},
|
|
|
|
onSuccess: (apiResp) async {
|
|
|
|
onSuccess: (apiResp) async {
|
|
|
|
LoadingUtils.hideFullScreenLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
await Future.delayed(Duration(milliseconds: 50)).then((value) async {
|
|
|
|
await Future.delayed(Duration(milliseconds: 50)).then((value) async {
|
|
|
|
LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: true, loadingText: LocaleKeys.appointmentSuccess.tr());
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
await Future.delayed(Duration(milliseconds: 4000)).then((value) {
|
|
|
|
GetIt.instance<NavigationService>().navigatorKey.currentContext!,
|
|
|
|
setIsPatientRescheduleAppointment(false);
|
|
|
|
child: Utils.getSuccessWidget(loadingText: LocaleKeys.appointmentSuccess.tr()).paddingSymmetrical(0.h, 24.h),
|
|
|
|
LoadingUtils.hideFullScreenLoader();
|
|
|
|
callBackFunc: () {
|
|
|
|
Navigator.pushAndRemoveUntil(
|
|
|
|
setIsPatientRescheduleAppointment(false);
|
|
|
|
navigationService.navigatorKey.currentContext!,
|
|
|
|
Navigator.pushAndRemoveUntil(
|
|
|
|
CustomPageRoute(
|
|
|
|
navigationService.navigatorKey.currentContext!,
|
|
|
|
page: LandingNavigation(),
|
|
|
|
CustomPageRoute(
|
|
|
|
),
|
|
|
|
page: LandingNavigation(),
|
|
|
|
(r) => false);
|
|
|
|
),
|
|
|
|
});
|
|
|
|
(r) => false);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
|
|
|
isCloseButtonVisible: false,
|
|
|
|
|
|
|
|
isAutoDismiss: true
|
|
|
|
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
LoadingUtils.hideFullScreenLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!),
|
|
|
|
title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!),
|
|
|
|
navigationService.navigatorKey.currentContext!,
|
|
|
|
navigationService.navigatorKey.currentContext!,
|
|
|
|
@ -933,22 +940,28 @@ class BookAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
await cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel).then((val) async {
|
|
|
|
await cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel).then((val) async {
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
Future.delayed(Duration(milliseconds: 50)).then((value) async {});
|
|
|
|
Future.delayed(Duration(milliseconds: 50)).then((value) async {});
|
|
|
|
LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: LocaleKeys.bookingYourAppointment.tr());
|
|
|
|
LoaderBottomSheet.showLoader(loadingText: LocaleKeys.bookingYourAppointment.tr());
|
|
|
|
await insertSpecificAppointment(
|
|
|
|
await insertSpecificAppointment(
|
|
|
|
onError: (err) {},
|
|
|
|
onError: (err) {},
|
|
|
|
onSuccess: (apiResp) async {
|
|
|
|
onSuccess: (apiResp) async {
|
|
|
|
LoadingUtils.hideFullScreenLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
await Future.delayed(Duration(milliseconds: 50)).then((value) async {
|
|
|
|
await Future.delayed(Duration(milliseconds: 50)).then((value) async {
|
|
|
|
LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: true, loadingText: LocaleKeys.appointmentSuccess.tr());
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
await Future.delayed(Duration(milliseconds: 4000)).then((value) {
|
|
|
|
GetIt.instance<NavigationService>().navigatorKey.currentContext!,
|
|
|
|
LoadingUtils.hideFullScreenLoader();
|
|
|
|
child: Utils.getSuccessWidget(loadingText: LocaleKeys.appointmentSuccess.tr()).paddingSymmetrical(0.h, 24.h),
|
|
|
|
Navigator.pushAndRemoveUntil(
|
|
|
|
callBackFunc: () {
|
|
|
|
navigationService.navigatorKey.currentContext!,
|
|
|
|
setIsPatientRescheduleAppointment(false);
|
|
|
|
CustomPageRoute(
|
|
|
|
Navigator.pushAndRemoveUntil(
|
|
|
|
page: LandingNavigation(),
|
|
|
|
navigationService.navigatorKey.currentContext!,
|
|
|
|
),
|
|
|
|
CustomPageRoute(
|
|
|
|
(r) => false);
|
|
|
|
page: LandingNavigation(),
|
|
|
|
});
|
|
|
|
),
|
|
|
|
|
|
|
|
(r) => false);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
|
|
|
isCloseButtonVisible: false,
|
|
|
|
|
|
|
|
isAutoDismiss: true
|
|
|
|
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
@ -994,7 +1007,7 @@ class BookAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
(apiResponse) {
|
|
|
|
(apiResponse) {
|
|
|
|
if (apiResponse.messageStatus == 2) {
|
|
|
|
if (apiResponse.messageStatus == 2) {
|
|
|
|
// onError!(apiResponse);
|
|
|
|
// onError!(apiResponse);
|
|
|
|
LoadingUtils.hideFullScreenLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!),
|
|
|
|
title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!),
|
|
|
|
navigationService.navigatorKey.currentContext!,
|
|
|
|
navigationService.navigatorKey.currentContext!,
|
|
|
|
@ -1030,22 +1043,28 @@ class BookAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
await cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel).then((val) async {
|
|
|
|
await cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel).then((val) async {
|
|
|
|
navigationService.pop();
|
|
|
|
navigationService.pop();
|
|
|
|
Future.delayed(Duration(milliseconds: 50)).then((value) async {});
|
|
|
|
Future.delayed(Duration(milliseconds: 50)).then((value) async {});
|
|
|
|
LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: LocaleKeys.bookingYourAppointment.tr());
|
|
|
|
LoaderBottomSheet.showLoader(loadingText: LocaleKeys.bookingYourAppointment.tr());
|
|
|
|
await insertSpecificAppointment(
|
|
|
|
await insertSpecificAppointment(
|
|
|
|
onError: (err) {},
|
|
|
|
onError: (err) {},
|
|
|
|
onSuccess: (apiResp) async {
|
|
|
|
onSuccess: (apiResp) async {
|
|
|
|
LoadingUtils.hideFullScreenLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
await Future.delayed(Duration(milliseconds: 50)).then((value) async {
|
|
|
|
await Future.delayed(Duration(milliseconds: 50)).then((value) async {
|
|
|
|
LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: true, loadingText: LocaleKeys.appointmentSuccess.tr());
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
await Future.delayed(Duration(milliseconds: 4000)).then((value) {
|
|
|
|
GetIt.instance<NavigationService>().navigatorKey.currentContext!,
|
|
|
|
LoadingUtils.hideFullScreenLoader();
|
|
|
|
child: Utils.getSuccessWidget(loadingText: LocaleKeys.appointmentSuccess.tr()).paddingSymmetrical(0.h, 24.h),
|
|
|
|
Navigator.pushAndRemoveUntil(
|
|
|
|
callBackFunc: () {
|
|
|
|
navigationService.navigatorKey.currentContext!,
|
|
|
|
setIsPatientRescheduleAppointment(false);
|
|
|
|
CustomPageRoute(
|
|
|
|
Navigator.pushAndRemoveUntil(
|
|
|
|
page: LandingNavigation(),
|
|
|
|
navigationService.navigatorKey.currentContext!,
|
|
|
|
),
|
|
|
|
CustomPageRoute(
|
|
|
|
(r) => false);
|
|
|
|
page: LandingNavigation(),
|
|
|
|
});
|
|
|
|
),
|
|
|
|
|
|
|
|
(r) => false);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
|
|
|
isCloseButtonVisible: false,
|
|
|
|
|
|
|
|
isAutoDismiss: true
|
|
|
|
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
@ -1539,7 +1558,7 @@ class BookAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
(apiResponse) {
|
|
|
|
(apiResponse) {
|
|
|
|
if (apiResponse.messageStatus == 2) {
|
|
|
|
if (apiResponse.messageStatus == 2) {
|
|
|
|
LoadingUtils.hideFullScreenLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!),
|
|
|
|
title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!),
|
|
|
|
navigationService.navigatorKey.currentContext!,
|
|
|
|
navigationService.navigatorKey.currentContext!,
|
|
|
|
|