Open Zookey opened 1 year ago
The answer is yes. I have been using device_calendar for some time now, and I have not seen this problem. My guess it is in your code rather than in the code of the device_calendar.
Afaik createOrUpdateEvent
takes an Event
as an argument. If the eventId
field is set to null
(or the eventId
is invalid) a new Event
will be created with an Id chosen by the device. This Id will be returned from createOrUpdateEvent
.
Note: You can theoretically set the eventId
field in your Dart-Code to any value of type String?
. It will only be honored when it is a valid Id, i.e. the Id of a previously created Event
.
In order to update an existing Event
the eventId
must be the Id of a previously created Event.
You can get this Id by first retrieving Event
s in a relevant timeframe. Note: On iOS this timeframe must not be longer than a couple of years or no Event
s will be returned.
Steps to update an Event
:
Event
s in the relevant timeframeEvent
you want to update from the returned List<Event>
Event
instance, but do not modify eventId
createOrUpdateEvent
with the modified Event
instance
Hi,
I am adding events to the calendar, but my users are complaining about duplicate events, when they by mistake or intentionally tap on the button to add events to the calendar.
I am using createOrUpdateEvent(), but as far as I can see eventId is a private field and I can not modify it.
Is it possible to create events without duplicates?