getVisibleDates function
Get the visible dates based on the date value and visible dates count.
Implementation
// ignore: always_specify_types
List getVisibleDates(dynamic date, List<int>? nonWorkingDays,
int firstDayOfWeek, int visibleDatesCount) {
// ignore: always_specify_types
List datesCollection;
if (date is HijriDateTime) {
datesCollection = <HijriDateTime>[];
} else {
datesCollection = <DateTime>[];
}
final dynamic currentDate =
getFirstDayOfWeekDate(visibleDatesCount, date, firstDayOfWeek);
for (int i = 0; i < visibleDatesCount; i++) {
final dynamic visibleDate = addDays(currentDate, i);
if (nonWorkingDays != null &&
nonWorkingDays.contains(visibleDate.weekday)) {
continue;
}
datesCollection.add(visibleDate);
}
return datesCollection;
}