pod library

A dependency injection and state management library for Dart.

See Pod in GitHub

Classes

AsyncData<T>
Creates an AsyncValue with a data.
AsyncError<T>
Creates an AsyncValue in the error state.
AsyncLoading<T>
Creates an AsyncValue in loading state.
AsyncNotifier<T>
A Notifier implementation that is asynchronously initialized.
AsyncValue<T>
A utility for safely manipulating asynchronous data.
Notifier<State>
A class which exposes a state that can change over time.
NotifierBase
A base class for Notifier and AsyncNotifier.
Override<T>
Override Pods.
Pod<T>
The base class for all pods.
PodConfigMixin<P extends Pod>
Configuration Mixin for Pod
PodContainer
Responsible for mapping pod's to their state.
PodFuture<F extends Pod, T>
See futurePod.
PodFutureBase<F extends Pod, T>
See futurePod.
PodNotifier<N extends Pod, T>
A Notifier Pod.
PodNotifierBase<N extends Pod, T>
PodNotifier base class.
PodStream<P extends Pod, T>
A Pod for Stream's.
PodStreamBase<P extends Pod, T>
See streamPod.
ReadPod<T>
See pod.
ReadPodBase<Value>
See pod.
Ref<Value>
Passed to the Pod.read method, allowing you to interact with other pods and manage the lifecycle of your state.
RefreshablePodFuture<F extends Pod, T>
RefreshablePod for Future's.
RefreshablePodNotifier<N extends Pod, T>
RefreshablePod for PodNotifier.
RefreshablePodStream<P extends Pod, T>
RefreshablePod for PodStream class.
RefreshableReadPod<T>
See pod.
RefreshableWritablePod<T, V>
Create a Refreshable WritablePod.
StatePod<T>
Represents an Pod that can be written to.
WritablePod<T, V>
Represents an Pod that can be written to.
WritablePodBase<T, V>
Represents an Pod that can be written to.

Mixins

RefreshablePod
RefreshablePod mixin that contains a refresh behaviour.
RefreshablePodMixin<P extends RefreshablePod>
RefreshablePodMixin that contains a refreshable method.

Extensions

AsyncNotifierX on AsyncNotifier<T>
An extension that adds methods like guard to an AsyncNotifier.
AsyncValuePodExtension on Pod<AsyncValue<T>>
AsyncValue extension.
AsyncValueX on AsyncValue<T>
An extension that adds methods like when to an AsyncValue.
PodExtension on Pod<T>
Pod extension.
PodFutureExtension on PodFuture<P, AsyncValue<V>>
PodFuture extension.

Functions

asyncNotifierPod<N extends AsyncNotifier<T>, T>(N create()) PodNotifier<Pod<N>, AsyncValue<T>>
A pod which creates and listen to an AsyncNotifier.
familyPod<T extends Pod, Arg>(T create(Arg arg)) → T Function(Arg arg)
Create a family factory function, for indexing similar pods with the Arg type.
futurePod<T>(ReaderPod<Future<T>> create) FuturePod<T>
Create a PodFuture that returns a AsyncValue representing the current state of the Future's execution.
internalPodNotifier<N extends Pod, T>(N notifier, T create(Ref<T> ref, N notifier)) PodNotifier<N, T>
Create a Pod that is linked to a notifier Pod.
notifierPod<N extends Notifier<T>, T>(N create()) PodNotifier<Pod<N>, T>
A pod which exposes a Notifier and listens to it.
pod<Value>(ReaderPod<Value> create) ReadPod<Value>
Create a read only pod that can interact with other pod's to create derived state.
statePod<Value>(Value initialValue) WritablePod<Value, Value>
Create a simple pod with mutable state.
streamPod<T>(ReaderPod<Stream<T>> create) StreamPod<T>
Create a Pod of a Stream.
weakFamilyPod<T extends Pod, Arg>(T create(Arg arg)) → T Function(Arg arg)
Alternate version of familyPod that holds a weak reference to each child.
writablePod<T, V>(ReaderPod<T> reader, WriterPod<T, V> writer) WritablePod<T, V>
Creates an WritablePod that can be used to implement custom write logic.

Typedefs

FuturePod<T> = PodFuture<Pod<Future<T>>, AsyncValue<T>>
Represents a PodFuture for an async operation.
GetPod = T Function<T>(Pod<T> pod)
Represents a function that retrieves an Pod's value.
ListenerCallback<T> = void Function(T state)
A listener that can be added to a NotifierBase using Notifier.addListener.
ReaderPod<T> = T Function(Ref<T> ref)
A function that creates a value from an Ref
RemoveListener = void Function()
A callback to remove a listener from notifier.
SetPod = void Function<T, V>(WritablePod<T, V> pod, V value)
Represents a function that sets a WritablePod's value.
SetSelf<T> = void Function(T value)
Represents function that sets the current pod's value
StreamPod<T> = PodStream<Pod<Stream<T>>, AsyncValue<T>>
Represents a PodStream for a streaming operation.
WriterPod<T, V> = void Function(GetPod get, SetPod set, SetSelf<T> setSelf, V value)
Represents the writer argument to writablePod

Exceptions / Errors

NotifierListenerError
An error thrown when trying to update the state of a NotifierBase, but at least one of the listeners threw.