builttoroam / device_calendar

A cross platform plugin for modifying calendars on the user's device
https://pub.dev/packages/device_calendar
BSD 3-Clause "New" or "Revised" License
259 stars 258 forks source link

App crashes when creating event with RecurrenceRule(null) #542

Open Jonny5-5 opened 3 weeks ago

Jonny5-5 commented 3 weeks ago

Describe the bug When I create an event with recurrence, but the recurrence object is RecurrenceRule(null) the app crashes. Android and iOS

To Reproduce Steps to reproduce the behavior:

var event = Event(
  calendar,
  title: "Title",
  start: startTime,
  end: endTime,
  recurrenceRule: RecurrenceRule(null),
);

var result = await _deviceCalendarPlugin.createOrUpdateEvent(event);

Expected behavior Create an event with no Recurrence. Change RecurrenceFrequency to be non-nullable or change the handling of it to not use recurrence if RecurrenceFrequency is null.

Flutter doctor [√] Flutter (Channel stable, 3.22.0, on Microsoft Windows [Version 10.0.22631.3593], locale en-US) [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [√] Chrome - develop for the web [!] Visual Studio - develop Windows apps (Visual Studio Build Tools 2019 16.11.32) X The current Visual Studio installation is incomplete. Please use Visual Studio Installer to complete the installation or reinstall Visual Studio. [√] Android Studio (version 2022.3) [√] VS Code (version 1.90.0) [√] Connected device (4 available) [√] Network resources