Skip to content
pubscout

flutter_debouncer

2.1.1, released a year ago by an unverified publisher

A Flutter plugin providing debouncing and throttling utilities.

WASM-readyCopyleft license
$ flutter pub add flutter_debouncer
Source repository

What it does

A Flutter plugin that simplifies the implementation of debouncing and throttling logic for user interactions such as button presses and text input changes. It provides dedicated Debouncer and Throttler classes to manage execution timing.

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

Use it when

  • You need to limit the rate at which a function is called, such as handling search text input.
  • You want to prevent multiple rapid button clicks from triggering duplicate actions.

Skip it when

  • You are looking for a complete state management solution.
  • You need reactive streams or asynchronous utilities already covered by core Dart packages.

Strengths

  • Simple API with named parameters for debouncing and throttling.
  • Supports custom behavior types like leading-edge execution.

Weaknesses

  • Limited to basic timer-based debouncing and throttling.
  • GPL-3.0 license may not suit all projects.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
final Debouncer _debouncer = Debouncer();

void _handleTextFieldChange(String value) {
  const duration = Duration(milliseconds: 500);
  _debouncer.debounce(
    duration: duration,
    onDebounce: () {
      setState(() {
        debouncedText = value;
      });
    },
  );
}