High-performance, memory-safe, and lifecycle-aware traffic control for Flutter & Dart. Debounce, throttle, rate limiting (Token Bucket), and async concurrency control with Zero Silent Failures.
| Debounced Search | Anti-Spam Button | Async Submit |
|---|---|---|
![]() |
![]() |
![]() |
| Concurrency Replace | Hooks Edition | Riverpod Integration |
![]() |
![]() |
![]() |
Most libraries return void, causing "silent failures" where dropped operations appear to succeed. This library introduces ThrottlerResult and DebounceResult to ensure your code handles every outcome.
// β
Honest API β both branches required at compile time
final result = await throttler.call(() async => await processPayment(order));
result.when(
onExecuted: () => showSuccessDialog(), // Safe: payment actually ran
onDropped: () => showError('Busy!'), // Handled: user knows it failed
);Anti-spam button β 1 line:
ThrottledInkWell(onTap: () => processPayment(), child: Text('Pay \$99'))Debounced search:
final debouncer = Debouncer(duration: 300.ms);
TextField(onChanged: (s) => debouncer(() => search(s)))State management (Provider, Riverpod, GetX, Bloc):
class SearchController with ChangeNotifier, EventLimiterMixin {
void onSearch(String text) {
debounce('search', () async {
_results = await api.search(text);
notifyListeners();
});
}
@override
void dispose() { cancelAll(); super.dispose(); }
}| You are building... | Install |
|---|---|
| Flutter app | flutter_debounce_throttle |
| Flutter app + flutter_hooks | flutter_debounce_throttle_hooks |
| Flutter app + Riverpod | flutter_debounce_throttle_riverpod |
| Dart server / CLI / Serverpod | dart_debounce_throttle |
| Capability | This Library | easy_debounce | Manual Timer |
|---|---|---|---|
| Honest API (No Silent Failures) | β | β | β |
| Memory Safe (Auto-dispose) | β | β | β Leaky |
| Async & Future Support | β | β | β |
| Race Condition Control (4 modes) | β | β | β |
| Ready-to-use Widgets | β | β | β |
| Distributed Rate Limiting | β | β | β |
| Zero External Dependencies | 0 | 0 | 0 |
| 570+ tests | Unit, widget, integration, security, performance & stress tests |
| 98% coverage | Every branch and edge case verified |
| Security First | DoS protection and memory exhaustion guards built-in |
| Type-safe | Full generics, no dynamic, compile-time safety with when() |
| Memory-safe | Verified with Flutter LeakTracker to ensure zero leaks |
| FAQ | Common questions |
| API Reference | Complete class/method docs |
| Best Practices | Patterns & recommendations |
| Migration Guide | From easy_debounce, rxdart, manual Timer |
| Example App | Comprehensive interactive demos |
Made with craftsmanship by Brewkits





