isEventPast function
Returns true if the event is in the past (i.e. the end date is before the current date). params Event The event to check. returns bool True if the event is in the past.
Implementation
bool isEventPast(Event event) {
return (event.end != null && event.end!.isBefore(DateTime.now())) ||
event.start.add(const Duration(hours: 1)).isBefore(DateTime.now());
}