|
|
|
|
@ -24,19 +24,19 @@ showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, S
|
|
|
|
|
if (Platform.isAndroid) {
|
|
|
|
|
if (await PermissionService.isCalendarPermissionEnabled()) {
|
|
|
|
|
_showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted,
|
|
|
|
|
onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? (int) {});
|
|
|
|
|
onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? null);
|
|
|
|
|
} else {
|
|
|
|
|
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).calendarPermission, () async {
|
|
|
|
|
if (await Permission.calendarFullAccess.request().isGranted) {
|
|
|
|
|
_showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted,
|
|
|
|
|
onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? (int) {});
|
|
|
|
|
onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? null);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (await Permission.calendarFullAccess.request().isGranted) {
|
|
|
|
|
_showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted,
|
|
|
|
|
onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? (int) {});
|
|
|
|
|
onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -44,7 +44,7 @@ showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, S
|
|
|
|
|
final CalendarPlugin _myPlugin = CalendarPlugin();
|
|
|
|
|
|
|
|
|
|
Future<void> _showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, String eventId, String appoDateFormatted, String appoTimeFormatted,
|
|
|
|
|
{required Function onSuccess, required String title, required String description, required Function(int) onMultiDateSuccess}) async {
|
|
|
|
|
{required Function onSuccess, required String title, required String description, Function(int)? onMultiDateSuccess}) async {
|
|
|
|
|
return showDialog<void>(
|
|
|
|
|
context: context,
|
|
|
|
|
barrierDismissible: true, // user must tap button!
|
|
|
|
|
@ -77,7 +77,7 @@ Future<void> _showReminderDialog(BuildContext context, DateTime dateTime, String
|
|
|
|
|
text = "2 hours";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (onMultiDateSuccess == null) {
|
|
|
|
|
if (onMultiDateSuccess ==null) {
|
|
|
|
|
CalendarUtils calendarUtils = await CalendarUtils.getInstance();
|
|
|
|
|
calendarUtils
|
|
|
|
|
.createOrUpdateEvent(
|
|
|
|
|
|