validDateRange method Null safety

bool validDateRange(
  1. {required String fromDate,
  2. required String toDate}
)

Implementation

static bool validDateRange(
    {required String fromDate, required String toDate}) {
  if ((DateTimes.stringToDateTime(date: fromDate))
      .isBefore((DateTimes.stringToDateTime(date: toDate)))) {
    return true;
  } else {
    return false;
  }
}