Skip to content
pubscout

listen_it

6.0.0, released 2 months ago by flutter-it.dev

ValueListenable operators and reactive collections for Flutter and Dart

WASM-ready
$ flutter pub add listen_it
Source repository

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.

Works with

Packages commonly used together with listen_it: ones it builds on, ones built on it, and its own family.