value_notifier_tools library

Helpful lightweight tools for working with ValueNotifiers

Classes

HistoryValueNotifier<T>
Works like a ValueNotifier with the added benefit of maintaining an internal undo history that can be navigated through.
SelectValueNotifier<FromT, ToT>
A ValueNotifier that wraps another ValueNotifier and selects updates based on a provided function.
WhereValueNotifier<T>
A ValueNotifier that provides a custom updateShouldNotify function to determine whether the listener should be notified.
WhereValueNotifierFromParent<T>
A WhereValueNotifier that listens to a parent ValueNotifier and notifies listeners based on the provided updateShouldNotify function.

Mixins

HistoryValueNotifierMixin<T>
Use this mixin on any ValueNotifier to add a history functionality to it.
WhereValueNotifierMixin<T>
Use this mixin on any ValueNotifier to add a custom updateShouldNotify function to determine whether the listeners should be notified.

Extensions

SelectedValueNotifierX on ValueNotifier<T>
An extension on ValueNotifier that provides a where method to create a WhereValueNotifier from the notifier.
SelectValueNotifierX on ValueNotifier<FromT>
An extension on ValueNotifier that provides a select method to create a SelectValueNotifier from the notifier.

Typedefs

Selector<FromT, ToT> = ToT Function(FromT value)
A function that maps a value of type FromT to a value of type ToT.
WhereFilter<T> = bool Function(T previous, T next)
A function that compares the previous value with the new value and returns whether the listener should be notified.