flutter_observation library
Classes
-
Observable<
T> - A standalone observable value.
-
ObservableList<
E> - A growable list whose reads and in-place mutations participate in observation tracking.
-
ObservableMap<
K, V> - A map whose direct key reads are tracked independently while iteration observes the complete contents.
- ObservableModel
- Marks a concrete model for observation code generation.
- ObservableObject
- Common protocol implemented by generated and manually observable models.
-
ObservableSet<
E> - A set whose direct membership reads are tracked independently while iteration observes the complete contents.
- ObservableState
-
Marks an owned state factory whose return type must be an
ObservableObject. - ObservationAlwaysNotify
- Notifies after every assignment without comparing the previous value.
- ObservationDebug
- Optional diagnostics used by in-process tooling and the DevTools extension.
- ObservationDebugEvent
- A lightweight diagnostic event for observation tooling and tests.
- ObservationDebugListenerHandle
- A disposable registration returned by ObservationDebug.addListener.
- ObservationDebugSnapshotProvider
- A registrar-like object that can provide a serializable dependency graph.
- ObservationDevTools
- Debug/profile VM Service bridge consumed by the Flutter DevTools extension.
- ObservationIgnored
- Excludes a generated constructor property from observation tracking.
- ObservationInspector
- Debug-only access to Observation state for Flutter's selected Widget.
- ObservationInspectorTarget
- A weakly registered Flutter element that can be selected in the Inspector.
-
ObservationKey<
T> - A typed identity used to distinguish one observable property from another.
- ObservationObserver
- A consumer that can be invalidated when one of its observed properties changes.
- ObservationReadOnly
- Generates a getter without a public setter for a constructor property.
- ObservationRegistrar
- Stores the property-to-observer relationships for one observable object.
- ObservationSchedulers
- Common schedulers for continuous observation.
-
ObservationScope<
T> - Makes one model available to a descendant observation widget subtree.
-
ObservationStatefulWidget<
Model> -
An observation widget that creates and owns one long-lived
Model. - ObservationStatelessWidget
- A widget with no owned business state whose observable reads are tracked.
-
ObservationSubscription<
T> - A cancellable, continuously retracked observation.
- ObservationTracking
- Holds the observer associated with the currently executing synchronous tracking scope.
-
ObservationTrackingHandle<
T> - The value and cancellation handle produced by one-shot tracking.
- ObservationTransaction
- Coalesces observation invalidations produced by a group of mutations.
-
ObservationValueListenable<
T> - Adapts a derived observation value to Flutter's ValueListenable API.
- ObservationWidget
- Marks a Widget for reactive source generation.
- Observer
- A small reactive region that can be embedded in an existing widget tree.
- PlainState
-
Marks an owned state factory whose return type must not be an
ObservableObject. - StateAnnotation
- Common configuration shared by the two state annotations.
Enums
- ObservationDebugEventKind
- The kind of runtime event emitted by ObservationDebug.
Mixins
- ObservableModelMixin
- Adds an ObservationRegistrar and manual tracking helpers to a class.
-
ObservationStateMixin<
T extends StatefulWidget> - Adds observation tracking to an existing State subclass.
- ObservationWidgetDiagnostics
- Adds Observation business state as top-level Flutter Inspector properties.
Functions
-
observationTransaction<
T> (T body()) → T -
Runs
bodyas one observation transaction. -
observe<
T> (T read(), {required void onChange(T value), void onError(Object error, StackTrace stackTrace)?, bool fireImmediately = false, ObservationScheduler scheduler = ObservationSchedulers.microtask}) → ObservationSubscription< T> -
Continuously observes the properties read by
read. -
observeStream<
T> (T read(), {bool emitInitial = true}) → Stream< T> -
Creates a single-subscription stream of values derived by
read. -
runObservationCallbacks(
Iterable< void Function()> callbacks) → void - Runs every callback in order, even when one or more callbacks throw.
-
toValueListenable<
T> (T read(), {bool notifyOnEqual = false, ObservationScheduler scheduler = ObservationSchedulers.microtask, void onError(Object error, StackTrace stackTrace)?}) → ObservationValueListenable< T> - Creates a disposable ValueListenable projection of observed properties.
-
withCancellableObservationTracking<
T> (T apply(), {required void onChange()}) → ObservationTrackingHandle< T> - Tracks accesses like withObservationTracking and also returns a handle that can cancel the one-shot observation before a change occurs.
-
withObservationTracking<
T> (T apply(), {required void onChange()}) → T -
Tracks accesses in
applyand invokesonChangeon the first change.
Typedefs
- ObservationScheduler = void Function(void callback())
- Schedules a pending observation callback.