diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 507d7ec1..fa69d913 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResu import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; @@ -513,6 +514,9 @@ class _BookConfirmState extends State { widget.patientShareResponse = new PatientShareResponse.fromJson(res); navigateToBookSuccess(context, docObject, widget.patientShareResponse); }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + navigateToHome(context); print(err); }); } @@ -528,6 +532,9 @@ class _BookConfirmState extends State { widget.patientShareResponse = new PatientShareResponse.fromJson(res); navigateToBookSuccess(context, docObject, widget.patientShareResponse); }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + navigateToHome(context); print(err); }); } @@ -584,6 +591,10 @@ class _BookConfirmState extends State { } } + Future navigateToHome(context) async { + Navigator.of(context).popAndPushNamed(HOME); + } + Future navigateToBookSuccess(context, DoctorList docObject, PatientShareResponse patientShareResponse) async { GifLoaderDialogUtils.hideDialog(context);