From 660ec3a2072c72ec0a723d5f79f2e85cd4361f27 Mon Sep 17 00:00:00 2001 From: Aamir Date: Sun, 10 Mar 2024 17:27:56 +0300 Subject: [PATCH] changes local --- lib/uitl/CalendarUtils.dart | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/uitl/CalendarUtils.dart b/lib/uitl/CalendarUtils.dart index 3a1aa3c6..c61b07f6 100644 --- a/lib/uitl/CalendarUtils.dart +++ b/lib/uitl/CalendarUtils.dart @@ -2,14 +2,16 @@ import 'dart:async'; import 'dart:ui'; import 'package:device_calendar/device_calendar.dart'; +import 'package:manage_calendar_events/manage_calendar_events.dart' as mcn; final DeviceCalendarPlugin deviceCalendarPlugin = DeviceCalendarPlugin(); +final mcn.CalendarPlugin _myPlugin = mcn.CalendarPlugin(); class CalendarUtils { static Completer? _completer; - Calendar? get writableCalendars => calendars.firstWhere((c) => !c.isReadOnly!); - List calendars; + mcn.Calendar? get writableCalendars => calendars.firstWhere((c) => !c.isReadOnly!); + List calendars; CalendarUtils._(this.calendars); @@ -19,9 +21,9 @@ class CalendarUtils { if (_completer == null) { _completer = await Completer(); try { - final calendarsResult = await deviceCalendarPlugin.retrieveCalendars(); + final List? calendarsResult = await _myPlugin.getCalendars(); // if (calendarsResult.data != null) - _completer?.complete(await CalendarUtils._(await calendarsResult.data!)); + _completer?.complete(await CalendarUtils._(await calendarsResult!)); } on Exception catch (e) { _completer!.completeError(e); final Future sharedPrefsFuture = _completer!.future; @@ -88,7 +90,7 @@ class CalendarUtils { }); } - deleteEvent(Calendar _calendar, Event _event) async { + deleteEvent(mcn.Calendar _calendar, Event _event) async { await deviceCalendarPlugin.deleteEvent(_calendar.id, _event.eventId); }