run method

void run(
  1. void action()
)

Executes the action if the throttle is not currently active.

If run, the throttle becomes active immediately and will ignore subsequent calls until the duration has passed.

Implementation

void run(void Function() action) {
  if (_isThrottled) return;
  _isThrottled = true;
  action();
  Future.delayed(duration, () => _isThrottled = false);
}