From 21f4807e0172a0986b018e273f395f98afe47468 Mon Sep 17 00:00:00 2001 From: Julius Bredemeyer <48645716+IVLIVS-III@users.noreply.github.com> Date: Wed, 2 Nov 2022 14:02:28 +0100 Subject: [PATCH] Removed platform-specific logic from the example app. Now that we have multi-day all-day events on both platforms (see https://github.com/builttoroam/device_calendar/pull/450), handling the platforms differently is no longer necessary. --- .../presentation/pages/calendar_event.dart | 65 +++++++++---------- 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/example/lib/presentation/pages/calendar_event.dart b/example/lib/presentation/pages/calendar_event.dart index 431b9b03..f8896262 100644 --- a/example/lib/presentation/pages/calendar_event.dart +++ b/example/lib/presentation/pages/calendar_event.dart @@ -332,41 +332,38 @@ class _CalendarEventPageState extends State { }, ), ), - // Only add the 'To' Date for non-allDay events on all - // platforms except Android (which allows multiple-day allDay events) - if (_event?.allDay == false || Platform.isAndroid) - Padding( - padding: const EdgeInsets.all(10.0), - child: DateTimePicker( - labelText: 'To', - selectedDate: _endDate, - selectedTime: _endTime, - enableTime: _event?.allDay == false, - selectDate: (DateTime date) { - setState( - () { - var currentLocation = - timeZoneDatabase.locations[_timezone]; - if (currentLocation != null) { - _endDate = - TZDateTime.from(date, currentLocation); - _event?.end = _combineDateWithTime( - _endDate, _endTime); - } - }, - ); - }, - selectTime: (TimeOfDay time) { - setState( - () { - _endTime = time; - _event?.end = - _combineDateWithTime(_endDate, _endTime); - }, - ); - }, - ), + Padding( + padding: const EdgeInsets.all(10.0), + child: DateTimePicker( + labelText: 'To', + selectedDate: _endDate, + selectedTime: _endTime, + enableTime: _event?.allDay == false, + selectDate: (DateTime date) { + setState( + () { + var currentLocation = + timeZoneDatabase.locations[_timezone]; + if (currentLocation != null) { + _endDate = + TZDateTime.from(date, currentLocation); + _event?.end = _combineDateWithTime( + _endDate, _endTime); + } + }, + ); + }, + selectTime: (TimeOfDay time) { + setState( + () { + _endTime = time; + _event?.end = + _combineDateWithTime(_endDate, _endTime); + }, + ); + }, ), + ), if (_event?.allDay == false && Platform.isAndroid) Padding( padding: const EdgeInsets.all(10.0),