flow_vm library

Classes

ActionFlow<T>
A class that represents an action flow without an initial value.
DataFlow<T>
A class that represents a data flow with an initial value.
Disposable
An abstract interface class that defines a disposable resource.
Disposer<T extends Disposable>
A widget that manages the lifecycle of a Disposable target.
FlowBuilder<T>
A widget that listens to a DataFlow and rebuilds when the value changes.
FlowListener<T>
A widget that listens to changes in a FlowVm and triggers a callback when the value changes.
FlowVm<T>
A sealed class that provides base functionality for managing state using a FlowNotifier.
Intent
A class representing an intent that performs an action on a FlowVm.
MutableFlow<T>
A sealed class that defines a mutable interface for FlowVm.
Mutation<T>
SimpleViewModel
A simplified version of ViewModel that provides an Updater for updates.
Transformers
A collection of helpers for shaping how Intent streams are consumed and mapped into other Intents.
Updater
An abstract interface that defines a method for updating a FlowVm with a MutableFlow.
UpdaterImpl
An implementation of Updater used to manage state changes.
ViewModel
The ViewModel class provides the base functionality for managing intents and flows.
ViewModelObserver

Functions

actionFlow(Never never) → Never
Throws an exception if ActionFlow is initialized incorrectly.
dataFlow(Never never) → Never
Throws an exception if DataFlow is initialized incorrectly.

Typedefs

Builder<T> = Widget Function(BuildContext context, T data)
A type definition for a function that builds a widget tree with the given data of type T.
Change<T> = T Function(T it)
A function type that represents a transformation of a value of type T.
IntentAction = FutureOr<void> Function(Updater update)
A function type representing an action that takes an Updater for state updates.
IntentMapper = Stream<Intent> Function(Intent intent)
A function type representing a mapper that transforms an Intent.
IntentTransformer = Stream<Intent> Function(Stream<Intent> intents, IntentMapper mapper)
Signature of an intent transformer function.
Listener<T> = void Function(BuildContext context, T data)
A type definition for a function that is called with the given data of type T whenever the value changes.
TargetBuilder<T extends Disposable> = Widget Function(BuildContext context, T target)
A type definition for a function that builds a widget tree with the given target of type T.
TargetCreator<T extends Disposable> = T Function(BuildContext context)
A type definition for a function that creates a target of type T.