SideEffects<T> class Null safety

Side effect to be called when the state is initialized, mutated and disposed of

See named constructor SideEffects.onData, SideEffects.onError, SideEffects.onWaiting SideEffects.onAll, and SideEffects.onOrElse

Constructors

SideEffects({void initState()?, void dispose()?, void onSetState(SnapState<T>)?, VoidCallback? onAfterBuild})
Side effect to be called when the state is initialized, mutated and disposed of [...]
SideEffects.onAll({required void onWaiting()?, required void onError(dynamic err, VoidCallback refresh)?, required void onData(T data)?})
Handle all possible for state status. Null argument will be ignored.
factory
SideEffects.onData(void data(T data))
Side effect to be called when he state is mutated successfully with data
factory
SideEffects.onError(void onError(dynamic err, VoidCallback refresh))
Side effect to be called when the state has error.
factory
SideEffects.onOrElse({void onWaiting()?, void onError(dynamic err, VoidCallback refresh)?, void onData(T data)?, required void orElse(T data)})
Handle the three state status with one required fallback callback.
factory
SideEffects.onWaiting(void onWaiting())
Side effect to be called while waiting for the state to resolve
factory

Properties

dispose → (void Function?()?)
Side effect to be called when the state is disposed of,
final
hashCode int
The hash code for this object. [...]
read-only, inherited
initState → (void Function?()?)
Side effect to be called when the state is first initialized
final
onAfterBuild → (void Function?()?)
read-only
onSetState → (void Function?(SnapState<T>)?)
Side effect to be called when the state is mutated
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited