checForRecurringeDayEventFormValidation method

dynamic checForRecurringeDayEventFormValidation(
  1. EventNotificationModel eventData
)

checks for recurring event form validation based on the provided eventData

Implementation

dynamic checForRecurringeDayEventFormValidation(
    EventNotificationModel eventData) {
  if (eventData.event!.repeatDuration == null) {
    return 'add repeat cycle';
  }
  if (eventData.event!.repeatCycle == null) {
    return 'add repeat cycle category';
  } else if (eventData.event!.repeatCycle == RepeatCycle.WEEK &&
      eventData.event!.occursOn == null) {
    return 'select event day';
  } else if (eventData.event!.repeatCycle == RepeatCycle.MONTH &&
      eventData.event!.date == null) {
    return 'select event date';
  } else if (eventData.event!.startTime == null) {
    return 'add event start time';
  } else if (eventData.event!.endTime == null) {
    return 'add event end time';
  } else if (eventData.event!.endsOn == null) {
    return 'add event ending details';
  } else if (eventData.event!.endsOn == EndsOn.ON &&
      eventData.event!.endEventOnDate == null) {
    return 'add end event date';
  } else if (eventData.event!.endsOn == EndsOn.AFTER &&
      eventData.event!.endEventAfterOccurance == null) {
    return 'add event occurance';
  }
}