debounce_throttle
2.0.0, released 6 years ago by defylogic.dev
A debouncer and throttle for Futures, Streams, and callbacks.
WASM-readySingle maintainer
What it does
Provides Debouncer and Throttle classes that limit how often values are emitted. Works with plain callbacks, Futures and Stream sources. Emits debounced or throttled values via a broadcast stream.
AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to limit rapid user input such as search queries
- You want to reduce noise from high‑frequency sensor data
Skip it when
- You need full‑featured reactive operators beyond debounce/throttle
- You require code‑generation or complex state‑management
Strengths
- Null‑safe and lightweight
- Works with multiple async patterns (Future, Stream, callbacks)
- Simple API with broadcast streams
Weaknesses
- Only provides basic debounce/throttle functionality
- No built‑in cancellation or pause control
- No integration with larger reactive libraries
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
final debouncer = Debouncer<String>(Duration(milliseconds:200));
textEditingController.addListener(() => debouncer.value = textEditingController.text);
debouncer.values.listen((search) => submitSearch(search));Alternatives
Packages that do the same job and could replace debounce_throttle.
Works with
Packages commonly used together with debounce_throttle: ones it builds on, ones built on it, and its own family.
- simple_observabledebounce_throttle depends on itObservable class to watch value changes via callbacks, Future or Stream.
- super_tag_editorBuilt on debounce_throttleA Flutter widget for editing and managing tags with auto-suggestions and Material behavior.
- flutter_simple_multiselectBuilt on debounce_throttleA simple searchable single or multiselect widget for Flutter with static and async values.