listenables library

Classes

Animator<T>
An object that drives animations.
AsyncData<T>
An AsyncValue representing an operation that has completed or yielded a relevant result.
AsyncError<T>
Signifies that an asynchronous operation has encountered an error.
AsyncLoading<T>
An AsyncValue representing a Future that has yet to complete or a Stream that has yet to yield any values.
AsyncNotifier<T>
A ValueNotifier that can process Future and Stream objects.
AsyncSnapshot<T>
Immutable representation of the most recent interaction with an asynchronous computation.
AsyncValue<T>
A data class that stores information about an asynchronous operation, which could be a Future or Stream.
Completer<T>
A way to produce Future objects and to complete them later with a value or error.
DefaultAnimationStyle
Designates an AnimationStyle for descendant widgets to fall back to.
EventSink<T>
A Sink that supports adding errors.
Future<T>
The result of an asynchronous computation.
FutureOr<T>
A type representing values that are either Future<T> or T.
ListenablePlaceholder<T>
Similarly to Get objects, ListenablePlaceholder is intended to be declared with a global scope and accessed via Ref.watch calls, but their value is seldom (or never) accessed directly: instead a Substitution is added to an ancestor GetScope to redirect it to another value.
MediaQueryNotifier<T>
This notifier's purpose is similar to obtaining information from the ancestor MediaQuery widget but allows interfacing with APIs that accept ValueListenable objects.
MultiStreamController<T>
An enhanced stream controller provided by Stream.multi.
OverlayNotifier
A subclass of OverlayPortalController that sends a notification when show and hide are called.
ProxyAnimator<T>
An Animation object created from an Animator.
ProxyNotifier<Result, Input>
Selects a value from an existing ValueListenable and notifies when that value changes.
Ref
An object (usually an Element) that can subscribe to notifications from ValueListenable objects.
RefContext
A fancy BuildContext that also implements the following interfaces:
Stream<T>
A source of asynchronous data events.
StreamConsumer<S>
Abstract interface for a "sink" accepting multiple entire streams.
StreamController<T>
A controller with the stream it controls.
StreamIterator<T>
An Iterator-like interface for the values of a Stream.
StreamSink<S>
A object that accepts stream events both synchronously and asynchronously.
StreamSubscription<T>
A subscription on events from a Stream.
StreamTransformer<S, T>
Transforms a Stream.
StreamTransformerBase<S, T>
Base class for implementing StreamTransformer.
StreamView<T>
Stream wrapper that only exposes the Stream interface.
StyledAnimation<T>
Interface for an Animation that uses a Vsync to manage its Ticker and AnimationStyle.
SynchronousStreamController<T>
A stream controller that delivers its events synchronously.
TickerFuture
An object representing an ongoing Ticker sequence.
TickerProvider
An interface implemented by classes that can vend Ticker objects.
Timer
A countdown timer that can be configured to fire once or repeatedly.
ValueAnimation<T>
A ValueListenable whose value updates each frame over the specified duration to create a continuous visual transition.
ValueListenable<T>
An interface for subclasses of Listenable that expose a value.
Vsync
A TickerProvider that also applies an AnimationStyle.
VsyncDouble
A variant of AnimationController that implements the VsyncValue and StyledAnimation interfaces. (An Animation object can be obtained via toAnimation.)
VsyncValue<T>
A ValueListenable attached to a TickerProvider.
Zone
A zone represents an environment that remains stable across asynchronous calls.
ZoneDelegate
An adapted view of the parent zone.
ZoneSpecification
A parameter object with custom zone function handlers for Zone.fork.

Enums

ConnectionState
The state of connection to an asynchronous computation.

Mixins

DisposeGuard
Mixin for Get objects with a dispose method.
StrictNotifier
Ensures that the notifier only sends updates between frames.

Extension Types

VsyncRegistry
Since AnimationController does not expose its ticker provider field, this registry was created to track animations' Vsyncs.

Extensions

FutureExtensions on Future<T>
Convenience methods on futures.
FutureIterable on Iterable<Future<T>>
FutureRecord2 on (Future<T1>, Future<T2>)
Parallel operations on a record of futures.
FutureRecord3 on (Future<T1>, Future<T2>, Future<T3>)
Parallel operations on a record of futures.
FutureRecord4 on (Future<T1>, Future<T2>, Future<T3>, Future<T4>)
Parallel operations on a record of futures.
FutureRecord5 on (Future<T1>, Future<T2>, Future<T3>, Future<T4>, Future<T5>)
Parallel operations on a record of futures.
FutureRecord6 on (Future<T1>, Future<T2>, Future<T3>, Future<T4>, Future<T5>, Future<T6>)
Parallel operations on a record of futures.
FutureRecord7 on (Future<T1>, Future<T2>, Future<T3>, Future<T4>, Future<T5>, Future<T6>, Future<T7>)
Parallel operations on a record of futures.
FutureRecord8 on (Future<T1>, Future<T2>, Future<T3>, Future<T4>, Future<T5>, Future<T6>, Future<T7>, Future<T8>)
Parallel operations on a record of futures.
FutureRecord9 on (Future<T1>, Future<T2>, Future<T3>, Future<T4>, Future<T5>, Future<T6>, Future<T7>, Future<T8>, Future<T9>)
Parallel operations on a record of futures.
VsyncRegistryExtension on Vsync
Gives access to the VsyncRegistry within an Vsync declaration.

Functions

runZoned<R>(R body(), {Map<Object?, Object?>? zoneValues, ZoneSpecification? zoneSpecification, Function? onError}) → R
Runs body in its own zone.
runZonedGuarded<R>(R body(), void onError(Object error, StackTrace stack), {Map<Object?, Object?>? zoneValues, ZoneSpecification? zoneSpecification}) → R?
Runs body in its own error zone.
scheduleMicrotask(void callback()) → void
Runs a function asynchronously.
unawaited(Future<void>? future) → void
Explicitly ignores a future.

Typedefs

AsyncValueGetter<T> = Future<T> Function()
Signature for callbacks that are to asynchronously report a value on demand.
ControllerCallback = void Function()
Type of a stream controller's onListen, onPause and onResume callbacks.
ControllerCancelCallback = FutureOr<void> Function()
Type of stream controller onCancel callbacks.
CreatePeriodicTimerHandler = Timer Function(Zone self, ZoneDelegate parent, Zone zone, Duration period, void f(Timer timer))
The type of a custom Zone.createPeriodicTimer implementation function.
CreateTimerHandler = Timer Function(Zone self, ZoneDelegate parent, Zone zone, Duration duration, void f())
The type of a custom Zone.createTimer implementation function.
ErrorCallbackHandler = AsyncError? Function(Zone self, ZoneDelegate parent, Zone zone, Object error, StackTrace? stackTrace)
The type of a custom Zone.errorCallback implementation function.
ForkHandler = Zone Function(Zone self, ZoneDelegate parent, Zone zone, ZoneSpecification? specification, Map<Object?, Object?>? zoneValues)
The type of a custom Zone.fork implementation function.
HandleUncaughtErrorHandler = void Function(Zone self, ZoneDelegate parent, Zone zone, Object error, StackTrace stackTrace)
The type of a custom Zone.handleUncaughtError implementation function.
LerpCallback<T> = T? Function(T a, T b, double t)
Function signature for linear interpolation.
PrintHandler = void Function(Zone self, ZoneDelegate parent, Zone zone, String line)
The type of a custom Zone.print implementation function.
RefComputer<Result> = Result Function(Ref ref)
Signature for a callback that computes a result using a provided Ref.
RegisterBinaryCallbackHandler = ZoneBinaryCallback<R, T1, T2> Function<R, T1, T2>(Zone self, ZoneDelegate parent, Zone zone, R f(T1 arg1, T2 arg2))
The type of a custom Zone.registerBinaryCallback implementation function.
RegisterCallbackHandler = ZoneCallback<R> Function<R>(Zone self, ZoneDelegate parent, Zone zone, R f())
The type of a custom Zone.registerCallback implementation function.
RegisterUnaryCallbackHandler = ZoneUnaryCallback<R, T> Function<R, T>(Zone self, ZoneDelegate parent, Zone zone, R f(T arg))
The type of a custom Zone.registerUnaryCallback implementation function.
RunBinaryHandler = R Function<R, T1, T2>(Zone self, ZoneDelegate parent, Zone zone, R f(T1 arg1, T2 arg2), T1 arg1, T2 arg2)
The type of a custom Zone.runBinary implementation function.
RunHandler = R Function<R>(Zone self, ZoneDelegate parent, Zone zone, R f())
The type of a custom Zone.run implementation function.
RunUnaryHandler = R Function<R, T>(Zone self, ZoneDelegate parent, Zone zone, R f(T arg), T arg)
The type of a custom Zone.runUnary implementation function.
ScheduleMicrotaskHandler = void Function(Zone self, ZoneDelegate parent, Zone zone, void f())
The type of a custom Zone.scheduleMicrotask implementation function.
StreamCallback<T> = Stream<T> Function()
A Function that returns a Stream.
ViewFinder = FlutterView Function()
Signature for a ValueGetter that returns a FlutterView.
ZoneBinaryCallback<R, T1, T2> = R Function(T1, T2)
A two-argument function, like the argument to Zone.runBinary.
ZoneCallback<R> = R Function()
A no-argument function, like the argument to Zone.run.
ZoneUnaryCallback<R, T> = R Function(T)
A one-argument function, like the argument to Zone.runUnary.

Exceptions / Errors

DeferredLoadException
Thrown when a deferred library fails to load.
ParallelWaitError<V, E>
Error thrown when waiting for multiple futures, when some have errors.
TimeoutException
Thrown when a scheduled timeout happens while waiting for an async result.