diff --git a/CHANGELOG.md b/CHANGELOG.md index 78169284..4935346d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ - Fixed resizing the window automatically scrolls the page to the top in example app. [#480](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/480) - Adds support for dark theme. [#263](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/263) +- Add `eventId` parameter for backend compatibility. [#489](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/489) # [1.4.0 - 7 Jan 2025](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/tree/1.4.0) diff --git a/lib/src/calendar_event_data.dart b/lib/src/calendar_event_data.dart index 656b571a..6778b790 100644 --- a/lib/src/calendar_event_data.dart +++ b/lib/src/calendar_event_data.dart @@ -10,6 +10,9 @@ import '../calendar_view.dart'; /// {@macro calendar_event_data_doc} class CalendarEventData { + /// Unique identifier for the event. + final String? eventId; + /// Specifies date on which all these events are. final DateTime date; @@ -49,6 +52,7 @@ class CalendarEventData { /// {@macro calendar_event_data_doc} CalendarEventData({ + this.eventId, required this.title, required DateTime date, this.description, @@ -121,6 +125,7 @@ class CalendarEventData { /// Returns event data in [Map] format. /// Map toJson() => { + "eventId": eventId, "date": date, "startTime": startTime, "endTime": endTime, @@ -135,6 +140,7 @@ class CalendarEventData { /// as the arguments. /// CalendarEventData copyWith({ + String? eventId, String? title, String? description, T? event, @@ -148,6 +154,7 @@ class CalendarEventData { RecurrenceSettings? recurrenceSettings, }) { return CalendarEventData( + eventId: eventId ?? this.eventId, title: title ?? this.title, date: date ?? this.date, startTime: startTime ?? this.startTime, @@ -168,6 +175,7 @@ class CalendarEventData { @override bool operator ==(Object other) { return other is CalendarEventData && + eventId == other.eventId && date.compareWithoutTime(other.date) && endDate.compareWithoutTime(other.endDate) && ((event == null && other.event == null) || @@ -189,6 +197,7 @@ class CalendarEventData { @override int get hashCode => + eventId.hashCode ^ description.hashCode ^ descriptionStyle.hashCode ^ titleStyle.hashCode ^