run method
Runs the action only if the throttle duration has passed since the last run.
Implementation
void run(VoidCallback action) {
if (_isAllowed) {
action();
_isAllowed = false;
Timer(duration, () => _isAllowed = true);
}
}
Runs the action only if the throttle duration has passed since the last run.
void run(VoidCallback action) {
if (_isAllowed) {
action();
_isAllowed = false;
Timer(duration, () => _isAllowed = true);
}
}