throttleOnTapIfNeeded method

  1. @protected
VoidCallback? throttleOnTapIfNeeded()
inherited

Implementation

@protected
VoidCallback? throttleOnTapIfNeeded() {
  if (widget.isEnabled) {
    if (widget.shouldTrottleTime && widget.onTap != null) {
      subscribeToTrottlerEvents();

      return () => trottler.add(widget.onTap!);
    }

    unsubscribeToTrottlerEventsIfNeeded();

    return widget.onTap;
  }

  unsubscribeToTrottlerEventsIfNeeded();

  return null;
}