When we use the plugin without providing any calendar names, id, etc, and call the plugin from a simple button to get the list of calendars on the device. It also creates another calendar under the default name and properties.
final deviceCalendarPlugin = DeviceCalendarPlugin();
final result =
await deviceCalendarPlugin.retrieveCalendars();
print(result.data!.map((e) {
print(e.accountName);
print(e.id);
}));
To delete this calendar, we call the function deleteCalendar with its id which successfully deletes it.
final deleted =
await deviceCalendarPlugin.deleteCalendar("16");
print(deleted.data);
But it gets created again a few min later under a new id making it impossible to delete it for good.
To Reproduce
Steps to reproduce the behavior:
Create an instance of the plugin on a button
run the button
A calendar with default properties gets created
Expected behavior
Please change this behaviour to not create a calendar when a user is only calling the plugin to retrieve or delete functions or any other function that does not involve creating any calendar. Only create calendars when using createCalendar function.
Screenshots
Device(s) tested
This can be very important as not all device vendors do calendar in the same way.
Device: Xiaomi 11 Lite NE 5G
OS: Android 13
Plugin version: 4.3.1
Flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.6, on Microsoft Windows [Version 10.0.22621.1992], locale en-IN)
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Android Studio (version 2022.2)
[✓] VS Code, 64-bit edition (version 1.80.1)
[✓] Connected device (1 available)
[✓] Network resources
• No issues found!
Additional context
full code with button:
TextButton(
onPressed: () async {
final deviceCalendarPlugin = DeviceCalendarPlugin();
final deleted =
await deviceCalendarPlugin.deleteCalendar("16");
final result =
await deviceCalendarPlugin.retrieveCalendars();
print(result.data!.map((e) {
print(e.accountName);
print(e.id);
}));
print(deleted.data);
},
child: const Text(
"delete Calendar",
style: TextStyle(
fontSize: 18,
),
),
)
Describe the bug
When we use the plugin without providing any calendar names, id, etc, and call the plugin from a simple button to get the list of calendars on the device. It also creates another calendar under the default name and properties.
To delete this calendar, we call the function deleteCalendar with its id which successfully deletes it.
But it gets created again a few min later under a new id making it impossible to delete it for good.
To Reproduce Steps to reproduce the behavior:
Expected behavior Please change this behaviour to not create a calendar when a user is only calling the plugin to retrieve or delete functions or any other function that does not involve creating any calendar. Only create calendars when using createCalendar function.
Screenshots![Screenshot_2023-07-18-16-13-22-008_com.google.android.calendar~01.jpg](https://github.com/builttoroam/device_calendar/assets/45682747/4d4d12d4-771c-4f76-b421-6b74e10abecd)
Device(s) tested This can be very important as not all device vendors do calendar in the same way.
Flutter doctor
Additional context full code with button: