From 5e0eec2ba07fe9173a03d5a2e2a3b70f497a75b1 Mon Sep 17 00:00:00 2001 From: "taha.alam" Date: Thu, 22 Aug 2024 14:52:07 +0300 Subject: [PATCH] pop removed --- lib/pages/BookAppointment/widgets/reminder_dialog.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/pages/BookAppointment/widgets/reminder_dialog.dart b/lib/pages/BookAppointment/widgets/reminder_dialog.dart index a16876db..55418494 100644 --- a/lib/pages/BookAppointment/widgets/reminder_dialog.dart +++ b/lib/pages/BookAppointment/widgets/reminder_dialog.dart @@ -54,6 +54,7 @@ Future _showReminderDialog(BuildContext context, DateTime dateTime, String shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0.0)), insetPadding: EdgeInsets.all(21), child: ReminderDialog( + shouldPop: false, onClick: (int i) async { String text = ""; if (i == 0) { @@ -85,6 +86,7 @@ Future _showReminderDialog(BuildContext context, DateTime dateTime, String description: description ?? "At " + appoDateFormatted + " " + appoTimeFormatted, scheduleDateTime: dateTime, eventId: eventId); + Navigator.of(context).pop(); onSuccess(); } } else { @@ -100,8 +102,9 @@ Future _showReminderDialog(BuildContext context, DateTime dateTime, String class ReminderDialog extends StatefulWidget { Function? onClick; + bool? shouldPop; - ReminderDialog({this.onClick}); + ReminderDialog({this.onClick, this.shouldPop = true}); @override _ReminderDialogState createState() => _ReminderDialogState(); @@ -247,7 +250,9 @@ class _ReminderDialogState extends State { TranslationBase.of(context).save, () { widget.onClick!(i); - Navigator.pop(context); + if(widget.shouldPop == true) { + Navigator.pop(context); + } }, color: CustomColors.green, ),