getSchedule method
An ordered list of timestamp generated by this trigger for a
given period. This is mainly used for persistently scheduling
a list of AppTasks from triggers that implement the Schedulable
interface.
Implementation
@override
List<DateTime> getSchedule(DateTime from, DateTime to, [int max = 100]) {
List<DateTime> schedule = [];
DateTime timestamp = configuration!.firstOccurrence;
int count = 0;
while (timestamp.isBefore(to) && count < max) {
if (timestamp.isAfter(from)) schedule.add(timestamp);
timestamp = timestamp.add(configuration!.period);
count++;
}
return schedule;
}