Skip to content

Commit bfc8922

Browse files
rashi-simformPRBaraiya
authored andcommitted
fix: 🐛Fix recurring event not shown issue
1 parent aff0360 commit bfc8922

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

example/lib/widgets/add_event_form.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,7 @@ class _AddOrEditEventFormState extends State<AddOrEditEventForm> {
228228
),
229229
],
230230
),
231-
SizedBox(
232-
height: 15,
233-
),
231+
SizedBox(height: 15),
234232
TextFormField(
235233
controller: _descriptionController,
236234
focusNode: _descriptionNode,
@@ -573,11 +571,17 @@ class _AddOrEditEventFormState extends State<AddOrEditEventForm> {
573571
recurrenceEndOn: _selectedRecurrenceEnd ?? RecurrenceEnd.never,
574572
);
575573

574+
// Determine the appropriate endDate based on whether this is a recurring event
575+
final DateTime eventEndDate =
576+
(_selectedFrequency != RepeatFrequency.doNotRepeat)
577+
? _startDate.withoutTime
578+
: _endDate;
579+
576580
final event = CalendarEventData(
577581
date: _startDate,
578582
endTime: _endTime,
579583
startTime: _startTime,
580-
endDate: _endDate,
584+
endDate: eventEndDate,
581585
color: _color,
582586
title: _titleController.text.trim(),
583587
description: _descriptionController.text.trim(),

0 commit comments

Comments
 (0)