listen_it library
Reactive primitives for Flutter - observable collections and powerful operators
Provides rx-like extensions on Listenable and ValueListenable
to work with them almost as if it was a synchronous stream.
Each extension function returns a new Listenable that updates its value when the value of this changes
You can chain these functions to build complex processing pipelines from a simple Listenable
In the examples we use listen to react on value changes. Instead of applying listen you
could also pass the end of the function chain to a ValueListenableBuilder
Also includes reactive collections (ListNotifier, MapNotifier, SetNotifier) that automatically notify listeners when their contents change.
previously published as functional_listener
Classes
- CustomChangeNotifier
-
CustomValueNotifier<
T> -
Sometimes you want a ValueNotifier where you can control when its
listeners are notified. With the
CustomValueNotifieryou can do this: If you pass CustomNotifierMode.always for the mode parameter,notifierListenerswill be called everytime you assign a value to the value property independent of if the value is different from the previous one. If you pass CustomNotifierMode.manual for the mode parameter,notifierListenerswill not be called when you assign a value to the value property. You have to call it manually to notify the Listeners. Aditionally it has a listenerCount property that tells you how many listeners are currently listening to the notifier. - ListenableSubscription
-
Object that is returned by
listenthat allows you to stop the calling of the handler that you passed to it. -
ListNotifier<
T> -
A List that behaves like
ValueNotifierif its data changes. -
MapNotifier<
K, V> -
A Map that behaves like
ValueNotifierif its data changes. -
SetNotifier<
T> -
A Set that behaves like
ValueNotifierif its data changes.
Enums
Extensions
-
FunctionaListener
on ValueListenable<
T> -
extension functions on
ValueListenablethat allows you to work with them almost as if it was a synchronous stream. Each extension function returns a newValueNotifierthat updates its value when the value ofthischanges You can chain these functions to build complex processing pipelines from a simpleValueListenableIn the examples we use listen to react on value changes. Instead of applying listen you could also pass the end of the function chain to aValueListenableBuilder - FunctionaListener2 on Listenable