DisposableHook<T> class

A hook that memoizes a value and optionally calls a disposer on unmount.

Inheritance

Constructors

DisposableHook(T creator(), [void disposer(T state)?])

Properties

context BuildContext
The BuildContext of the widget that owns this hook.
no setterinherited
creator → T Function()
final
disposer → void Function(T state)?
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state → T
The current state value of this hook.
no setterinherited

Methods

activated() → void
Called when the widget is reactivated.
inherited
build() → T
Builds the initial state for this hook.
override
deactivated() → void
Called when the widget is deactivated.
inherited
didChangeDependencies() → void
Called when the widget's InheritedWidget dependencies change.
inherited
didUpdateWidget() → void
Called when the parent widget is updated with new properties.
inherited
mount() → void
Called after the hook is created and added to the widget.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reassemble() → void
Called during hot reload when this hook is reused.
inherited
toString() String
A string representation of this object.
inherited
unmount() → void
Called when the hook is being removed.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited