AsyncHookComponent class abstract

An experimental server-only component that may call hooks across awaits.

Call hooks in a deterministic, sequential order directly in build or its awaited helpers. Parallel branches, detached work, event handlers, and timer callbacks must not call hooks. Closed builds reject escaped hook calls. Effects remain inactive and live Future/Stream sources remain unsupported on the server. State is local to this element and is not serialized.

Failed builds release their hook resources. Successful builds retain them until unmount; HTTP response completion does not guarantee unmount. Manage request resources and async cleanup explicitly with try/finally.

Implementers

Constructors

AsyncHookComponent({Key? key})
Creates an async hook component. Do not annotate it with @client.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one component replaces another component in the tree.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildContext context) → Future<Component>
Builds the server subtree, optionally calling hooks before and after await.
createElement() → Element
Inflates this configuration to a concrete instance.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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