checkListContainsDate static method

bool checkListContainsDate({
  1. required List<DateTime> listOfDates,
  2. required DateTime date,
})

checking listOfDates has matching date in it

Implementation

static bool checkListContainsDate(
    {required List<DateTime> listOfDates, required DateTime date}) {
  return listOfDates.any((element) => (element.year == date.year &&
      element.month == date.month &&
      element.day == date.day));
}