ref/hooked/hooked library

Classes

Hook<Result, Data>
Allows a Widget to create and access its own mutable data without a State.
HookData<Result>
This class makes it easier for a Hook to work with a complex data model.
ObjectRef<T>
A class that stores a single value.

Mixins

HookElement
An Element that uses a HookWidget as its configuration.

Constants

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

Functions

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.
useValueListenable<T>(ValueListenable<T> valueListenable, {bool watching = true}) → T
Subscribes to a ValueListenable and returns its value.

Typedefs

GetHook<Result, Data> = ValueGetter<Hook<Result, Data>>
Signature for a callback that returns a Hook.