bloc_lens library

Classes

BlocBooleanLens<S>
An adaptation of a BoolLens for a BlocLens.
BlocEnumLens<S, T>
An adaptation of an EnumLens for a BlocLens.
BlocLens<S, T>
A BlocLens is a way to access a part of a BlocBase's state by coupling a getter and setter focused on a specific bloc instance.
BlocListLens<S, T>
An adaptation of a ListLens for a BlocLens.
BlocMapLens<S, K, V extends Object>
An adaptation of a MapLens for a BlocLens.
BlocNumberLens<S, T extends num>
An adaptation of a NumberLens for a BlocLens.
BoolLens
A BoolLens extends a standard Lens with boolean-specific operations.
DirectBoolLens
A boolean lens backed by explicitly provided getter and setter functions.
DirectEnumLens<T>
An enum lens backed by explicitly provided getter and setter functions.
DirectLens<T>
A lens backed by explicitly provided getter and setter functions.
DirectListLens<T>
A list lens backed by explicitly provided getter and setter functions.
DirectMapLens<K, V extends Object>
A map lens backed by explicitly provided getter and setter functions.
DirectNumberLens<T extends num>
A number lens backed by explicitly provided getter and setter functions.
EnumLens<T>
An EnumLens extends a standard Lens by allowing to cycle through a list of allowed values. next sets values in the order they are provided in values.
IndexLens<T>
An IndexLens manages a value at a specific index of a list. Uses a ListLens as a parent lens.
Lens<T>
A Lens object manages a value by providing get and set methods.
ListLens<T>
A ListLens extends a standard Lens with operations on a target list. It also provides a lens focused on a specific element of the list.
MapEntryLens<K, V extends Object>
A MapEntryLens extends a standard Lens with operations on a specific entry of a map.
MapLens<K, V extends Object>
A MapLens extends a standard Lens with operations on a target map.
NumberLens<T extends num>
A NumberLens extends a standard Lens with operations on a target number.

Extensions

BlocLensX on BlocBase<S>
Utility methods to create BlocLenses focused on a current BlocBase instance.

Typedefs

BlocGetter<S, T> = T Function(S state)
Signature for a function getting a value of type T from a state of type S.
BlocSetter<S, T> = S Function(S state, T value)
Signature for a function updating a state of type S with a value of type T.
Getter<T> = T Function()
Signature for a getter-like functions.
Setter<T> = void Function(T value)
Signature for a setter-like functions.