Skip to content
pubscout

tap_debouncer

2.2.0, released 4 years ago by blean.vip

A widget that wraps buttons and disables taps while the tap callback is in progress.

WASM-ready
$ flutter pub add tap_debouncer
Source repository

What it does

TapDebounce disables button taps automatically while an asynchronous callback is executing. It prevents accidental double-taps and allows configuring a cooldown duration or custom busy UI states.

AI-written summary of version 2.2.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to prevent users from rapidly tapping buttons multiple times
  • You need to disable navigation pop buttons during asynchronous operations

Skip it when

  • You need global state management instead of widget-level debouncing

Strengths

  • Simplifies preventing double-taps on buttons
  • Supports custom cooldown durations and exception handling
  • Provides builder callbacks to alter widget appearance during busy states

Weaknesses

  • Limited to tap debouncing on a per-widget basis

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0

not documented

TapDebouncer(
  onTap: () async => await someLongOperation(),
  builder: (BuildContext context, TapDebouncerFunc? onTap) {
    return RaisedButton(
      onPressed: onTap,
      child: const Text('Short'),
    );
  },
)

Alternatives

Packages that do the same job and could replace tap_debouncer.