Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
9 changes: 9 additions & 0 deletions lib/src/calendar_event_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import '../calendar_view.dart';

/// {@macro calendar_event_data_doc}
class CalendarEventData<T extends Object?> {
/// Unique identifier for the event.
final String? eventId;

/// Specifies date on which all these events are.
final DateTime date;

Expand Down Expand Up @@ -49,6 +52,7 @@ class CalendarEventData<T extends Object?> {

/// {@macro calendar_event_data_doc}
CalendarEventData({
this.eventId,
required this.title,
required DateTime date,
this.description,
Expand Down Expand Up @@ -121,6 +125,7 @@ class CalendarEventData<T extends Object?> {
/// Returns event data in [Map<String, dynamic>] format.
///
Map<String, dynamic> toJson() => {
"eventId": eventId,
"date": date,
"startTime": startTime,
"endTime": endTime,
Expand All @@ -135,6 +140,7 @@ class CalendarEventData<T extends Object?> {
/// as the arguments.
///
CalendarEventData<T> copyWith({
String? eventId,
String? title,
String? description,
T? event,
Expand All @@ -148,6 +154,7 @@ class CalendarEventData<T extends Object?> {
RecurrenceSettings? recurrenceSettings,
}) {
return CalendarEventData(
eventId: eventId ?? this.eventId,
title: title ?? this.title,
date: date ?? this.date,
startTime: startTime ?? this.startTime,
Expand All @@ -168,6 +175,7 @@ class CalendarEventData<T extends Object?> {
@override
bool operator ==(Object other) {
return other is CalendarEventData<T> &&
eventId == other.eventId &&
date.compareWithoutTime(other.date) &&
endDate.compareWithoutTime(other.endDate) &&
((event == null && other.event == null) ||
Expand All @@ -189,6 +197,7 @@ class CalendarEventData<T extends Object?> {

@override
int get hashCode =>
eventId.hashCode ^
description.hashCode ^
descriptionStyle.hashCode ^
titleStyle.hashCode ^
Expand Down