checkInterval method
Returns true if for each time the defined millisecond interval passes.
Like a Timer.periodic
Used in flows involved in the update
Implementation
bool checkInterval(
String key,
int intervalInMilli,
double dt, {
bool firstCheckIsTrue = true,
}) {
_timers ??= {};
if (_timers![key]?.interval != intervalInMilli) {
_timers![key] = IntervalTick(intervalInMilli);
return firstCheckIsTrue;
} else {
return _timers![key]?.update(dt) ?? false;
}
}