From 2eb9bd6fb22c3501673dc520c442d5ee83c42e9a Mon Sep 17 00:00:00 2001 From: Brett Lim Date: Wed, 22 Jan 2020 15:31:40 +1100 Subject: [PATCH] Updated to read the group in example app when editing an event --- .../example/lib/presentation/pages/calendar_event.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/device_calendar/example/lib/presentation/pages/calendar_event.dart b/device_calendar/example/lib/presentation/pages/calendar_event.dart index 08d3bda3..7c00cf03 100644 --- a/device_calendar/example/lib/presentation/pages/calendar_event.dart +++ b/device_calendar/example/lib/presentation/pages/calendar_event.dart @@ -106,6 +106,10 @@ class _CalendarEventPageState extends State { _weekOfMonth = _event.recurrenceRule.weekOfMonth ?? WeekNumber.First; _selectedDayOfWeek = _daysOfWeek.isNotEmpty ? _daysOfWeek.first : DayOfWeek.Monday; _dayOfMonth = _event.recurrenceRule.dayOfMonth ?? 1; + + if (_daysOfWeek.isNotEmpty) { + _updateDaysOfWeekGroup(); + } } } @@ -403,7 +407,7 @@ class _CalendarEventPageState extends State { } else { _daysOfWeek.remove(day); } - _updateDaysOfWeekGroup(day); + _updateDaysOfWeekGroup(selectedDay: day); }); }, ); @@ -725,7 +729,7 @@ class _CalendarEventPageState extends State { } } - void _updateDaysOfWeekGroup(DayOfWeek selectedDay) { + void _updateDaysOfWeekGroup({DayOfWeek selectedDay}) { var deepEquality = const DeepCollectionEquality.unordered().equals; // If _daysOfWeek contains Monday to Friday