get_hooked library

Classes

AnimationControllerStyled
AnimationStyleProvider
AppBarConst
A Material Design app bar.
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.
ClippedDecoration
A variation of DecoratedBox that allows specifying a clipBehavior and re-renders without any need to rebuild a widget subtree.
Completer<T>
A way to produce Future objects and to complete them later with a value or error.
ComputedScoped<Result>
ComputeRef
DefaultAnimationStyle
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.
GetScope
A widget that allows setting Substitutions for Get objects.
Hook<Result, Data>
Allows a Widget to create and access its own mutable data without a State.
HookBuilder
A HookWidget that delegates its build to a callback.
HookData<Result>
This class makes it easier for a Hook to work with a complex data model.
HookRef
HookWidget
A variation of a StatelessWidget that can call Hook functions in its HookWidget.build method.
ImmutableSubtree
Those darn times when 1 widget makes it so the entire thing can't be const.
MultiStreamController<T>
An enhanced stream controller provided by Stream.multi.
ObjectRef<T>
A class that stores a single value.
ProxyNotifier<T, L extends Listenable>
Transforms any Listenable into a ValueListenable.
ProxyNotifier2<T, L1, L2>
Transforms a pair of values into a ValueListenable.
ProxyNotifier3<T, L1, L2, L3>
Transforms three values into a ValueListenable.
ProxyNotifier4<T, L1, L2, L3, L4>
Transforms four values into a ValueListenable.
ProxyNotifier5<T, L1, L2, L3, L4, L5>
Transforms five values into a ValueListenable.
ProxyNotifier6<T, L1, L2, L3, L4, L5, L6>
Transforms six values into a ValueListenable.
ProxyNotifier7<T, L1, L2, L3, L4, L5, L6, L7>
Transforms seven values into a ValueListenable.
ProxyNotifier8<T, L1, L2, L3, L4, L5, L6, L7, L8>
Transforms eight values into a ValueListenable.
ProxyNotifier9<T, L1, L2, L3, L4, L5, L6, L7, L8, L9>
Transforms nine values into a ValueListenable.
ProxyNotifierBase<T>
RawText
A RenderObjectWidget that can display a String of text.
RefPaint
A variation of CustomPaint that interfaces with Get objects.
RenderClippedDecoration
Paints a Decoration.
RenderGet<Render extends RenderObject>
A simple widget that subscribes to a Get object and updates a RenderObject accordingly.
RenderGetBase
Extend this class to create a widget with a single child.
RenderScopedGetBase<T>
Extend this class to create a widget with a single child.
ScopedGet<T>
Creates pseudo-Get objects that throw when properties are accessed.
ScopeModel
An InheritedModel used by Ref to store its Overrides and notify dependent widgets.
Simulation
The base class for all simulations.
SpringDescription
Structure that describes a spring's constants.
StatefulHookWidget
A variation of a StatefulWidget that can call Hook functions in its State.build method.
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>
Substitution<V extends ValueRef>
Causes the static Ref methods to reference a different Get object.
SynchronousStreamController<T>
A stream controller that delivers its events synchronously.
TextGetter<T>
A widget displaying a string representation of a Get object's value.
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.
ToggleAnimation
An animation controller that toggles between two states.
ValueAnimation<T>
A ValueListenable whose value updates each frame over the specified duration to create a continuous visual transition.
ValueAnimationStyled<T>
ValueListenable<T>
An interface for subclasses of Listenable that expose a value.
Vsync
A TickerProvider implementation that can arbitrarily reconfigure its attached BuildContext.
VsyncTicker
A Ticker created by a Vsync.
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.
MaterialTextStyle
Selects a TextStyle from the ThemeData.textTheme.

Mixins

DisposeGuard
Mixin for Get objects with a dispose method.
HookElement
An Element that uses a HookWidget as its configuration.
TextStyleSelector
An object that resolves to a TextStyle by selecting from a TextTheme.

Extension Types

Get
Encapsulates a ValueListenable object with an interface for easy updates and automatic lifecycle management.
GetAsync
Encapsulates an AsyncNotifier.
GetComputed
Encapsulates a Listenable which notifies based on a RefComputer callback.
GetList
Encapsulates a ListNotifier and can be used as a List directly.
GetMap
Encapsulates a MapNotifier and can be used as a Map directly.
GetProxy
Encapsulates any Listenable, using the provided callback to retrieve a value.
GetSet
Encapsulates a SetNotifier and can be used as a Set directly.
GetValue
Encapsulates a ValueNotifier.
GetVsync
Encapsulates an Animation.
GetVsyncDouble
Encapsulates an AnimationController.
GetVsyncValue
Encapsulates a ValueAnimation.
PainterRef
A reference used in RefPaint.hitTest calls.
PaintingRef
An interface used by RefPaint.paint and RefPaint.buildSemantics.
ProxyListenable
Ref
A namespace for Hook functions that interact with Get objects.

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.
GetFromContext on BuildContext
Allows accessing the relevant value from an ancestor GetScope in a reasonably concise manner.
GetHooked on Get<Object?, V>
Allows the hook functions defined in Ref to access a Get object's ValueListenable.
SchedulerBuilding on SchedulerBinding
Provides an estimate regarding whether a build is imminent.
ToggleValue on GetValue<bool>
Toggles a boolean GetValue.
VsyncRef on ComputeRef

Constants

useAnimation → const T Function<T>(ValueListenable<T> valueListenable, {bool watching = true})
Animations are just ValueListenables with an AnimationStatus!

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.
use<Result, Data>(GetHook<Result, Data> getHook, {required Object? key, required Data data, required String debugLabel}) → Result
Registers a Hook and returns its value.
useAnimationStatus<T>(Animation<Object?> animation, T statusListener(AnimationStatus status)) → T
Calls the statusListener whenever the Animation.status changes.
useContext() BuildContext
Obtains the BuildContext of the building HookWidget.
useEffect(ValueGetter<VoidCallback?> effect, {Object? key}) → void
Invokes the effect callback, and calls it again whenever the key changes.
useListenable<L extends Listenable?>(L listenable, {bool watching = true}) → L
Subscribes to a Listenable and marks the widget as needing build whenever the listener is called.
useMemoized<T>(ValueGetter<T> valueGetter, {Object? key}) → T
Caches the instance of a complex object.
useRef<T>(T initialValue, {Object? key}) ObjectRef<T>
Creates an object containing a property which can be mutated without triggering rebuilds.
useSubstitute<G extends GetAny>(G get, Object replacer, {Object? key}) → G
Creates a Substitution and automatically applies it to the nearest ancestor GetScope.
useValueListenable<T>(ValueListenable<T> valueListenable, {bool watching = true}) → T
Subscribes to a ValueListenable and returns its value.

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.
GetAny = Get<Object?, ValueRef>
A generic type implemented by all Get objects.
GetGetter<V extends ValueRef> = ValueGetter<GetV<V>>
A callback that returns a Get object that wraps the specified ValueListenable.
GetHook<Result, Data> = ValueGetter<Hook<Result, Data>>
Signature for a callback that returns a Hook.
GetT<T> = Get<T, ValueListenable<T>>
Shorthand for specifying a Get object's first type argument.
GetV<V extends ValueRef> = Get<Object?, V>
Shorthand for specifying a Get object's second type argument.
GetVsyncA<A extends Animation<Object?>> = GetVsync<Object?, A>
Shorthand for specifying a GetVsync object's second type argument.
GetVsyncAny = GetVsync<Object?, Animation<Object?>>
A generic type implemented by all GetVsync objects.
GetVsyncT<T> = GetVsync<T, Animation<T>>
Shorthand for specifying a GetVsync object's first type argument.
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(ComputeRef ref)
RefPaintCallback = void Function(PaintingRef ref)
Signature for the callback within a RefPaint widget that paints a UI element, using a Canvas retrieved via PaintingRef.stageCanvas.
RefPaintHitTest = bool? Function(PainterRef ref, Offset location)
Signature for a callback that determines whether a RefPaint widget will absorb a hit test. If the function or its output is null, the widget defers to the default behavior as defined in RefPaint.hitTest.
RefPaintSemanticsBuilder = List<CustomPainterSemantics> Function(PaintingRef ref)
Builds semantics information describing the picture drawn by a RefPaintCallback. Each CustomPainterSemantics in the returned list is converted into a SemanticsNode by copying its properties.
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.
SubAny = Substitution<ValueRef>
A generic type that encompasses all Substitution objects.
SubtreeBuilder = Widget Function(BuildContext context, Object? key)
Builds a Widget, given the key from the ImmutableSubtree.placeholder.
ValueRef = ValueListenable<Object?>
A typedef that can represent any ValueListenable object.
VsyncBuilder<A extends Animation<Object?>> = A Function(Vsync vsync)
Creates an Animation using a TickerProvider.
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.
GetScopeError
Might as well use a fun little class for the scope errors!
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.