Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed platform-specific logic from the example app. #454

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
65 changes: 31 additions & 34 deletions example/lib/presentation/pages/calendar_event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -332,41 +332,38 @@ class _CalendarEventPageState extends State<CalendarEventPage> {
},
),
),
// 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),
Expand Down