getAllInstances method
Implementation
List<DateTime> getAllInstances({
required DateTime start,
DateTime? after,
bool includeAfter = false,
DateTime? before,
bool includeBefore = false,
}) {
assert(start.isValidRruleDateTime);
assert(after.isValidRruleDateTime);
assert(before.isValidRruleDateTime);
final key = CacheKey(
start: start,
after: after,
includeAfter: includeAfter,
before: before,
includeBefore: includeBefore,
);
final fromCache = _cache.get(key);
if (fromCache != null) return fromCache;
final results = getInstances(
start: start,
after: after,
includeAfter: includeAfter,
before: before,
includeBefore: includeBefore,
).toList(growable: false);
if (shouldCacheResults) {
_cache.add(key, results);
}
return results;
}