next method
Returns the next instance of the given date considering this Every
base process.
If the date is a DateTime that matches the Every pattern, a new
DateTime will be generated.
Implementation
@override
DateTime next(DateTime date) {
final sameDateWithTime = date.date.add(timeOfDay);
if (sameDateWithTime == date || sameDateWithTime.isBefore(date)) {
return sameDateWithTime.addDays(1);
}
return sameDateWithTime;
}