getDatesByDay method

List<DateTime> getDatesByDay(
  1. int year,
  2. int month,
  3. String day
)

Implementation

List<DateTime> getDatesByDay(int year, int month, String day) {
  Year y = years!.firstWhere((element) => element.value == year);
  Month m = y.months.firstWhere((element) => element.value == month);
  List<Day> d = m.days.where((element) => element.name.toLowerCase() == day.toLowerCase()).toList();
  return d.map((e) => DateTime(year, month, e.value)).toList();
}