showConcurrentEventDialog method

bool? showConcurrentEventDialog(
  1. List<EventNotificationModel>? createdEvents,
  2. EventNotificationModel? newEvent,
  3. BuildContext context
)

Implementation

bool? showConcurrentEventDialog(List<EventNotificationModel>? createdEvents,
    EventNotificationModel? newEvent, BuildContext context) {
  // ignore: prefer_is_empty
  if (!isEventUpdate && createdEvents != null && createdEvents.length > 0) {
    var isOverlapData =
        isEventTimeSlotOverlap(createdEvents, eventNotificationModel);
    if (isOverlapData[0]) {
      showDialog<void>(
          context: context,
          barrierDismissible: true,
          builder: (BuildContext context) {
            return ConcurrentEventRequest(concurrentEvent: isOverlapData[1]);
          });

      return isOverlapData[0];
    } else {
      return isOverlapData[0];
    }
  } else {
    return false;
  }
}