listen_it
6.0.0, released 2 months ago by flutter-it.dev
ValueListenable operators and reactive collections for Flutter and Dart
What it does
Provides observable collections (ListNotifier, MapNotifier, SetNotifier) and functional chainable operators for ValueListenables like map, select, where, debounce, and combineLatest. Chains automatically attach and detach from their sources based on listener count to prevent memory leaks.
AI-written summary of version 6.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want reactive state management using standard ValueListenables without heavy frameworks.
- You need collections that automatically notify listeners when mutated.
- You want to transform, filter, or debounce observables using a chainable API.
Skip it when
- You prefer full-fledged BloC, Riverpod, or Redux architectures for your application state.
- Your transformation functions are not pure or cheap, as they may run on read while detached.
Strengths
- Automatic lifecycle management with detach-on-last-listener to prevent memory leaks.
- Reactive collections require no manual notifyListeners() calls on mutations.
- Type-safe ValueListenable operators with stream-like patterns.
Weaknesses
- Transformation functions must be pure and cheap since they can be invoked on read while the chain is unobserved.
- Does not include built-in dependency injection or complex navigation.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
final todos = ListNotifier<String>();
final searchTerm = ValueNotifier<String>('');
searchTerm
.debounce(const Duration(milliseconds: 300))
.where((term) => term.length >= 3)
.listen((term, _) => print(term));Alternatives
Packages that do the same job and could replace listen_it.
- rx_notifier
Extends ValueNotifier with functional reactive programming and observers.
50Compare - async_listenable
Provides a ValueListenable‑like API for async operations, exposing an AsyncSnapshot.
43Compare
Works with
Packages commonly used together with listen_it: ones it builds on, ones built on it, and its own family.
- watch_itBuilt on listen_itState management powered by get_it to observe changes and rebuild widgets automatically.
- command_itBuilt on listen_itWrap sync and async functions as callable Command objects with reactive state.
- flutter_itBuilt on listen_itRe-exports get_it, watch_it, command_it, and listen_it for a single import.