run method

void run(
  1. VoidCallback action
)

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);
  }
}