RefNode class

Attaches a Ref to the first web.Element created by child.

In the browser, the mount engine inspects the DOM nodes emitted by child, attaches the first Element instance to ref, and registers Ref.detach into the region's disposer list to clear the ref when unmounted.

In SSR (renderToHtml), child renders normally and ref remains unattached.

final canvasRef = Ref<Object>();

BloomNode chart() => RefNode(
  canvasRef,
  Canvas(attrs: {'id': 'telemetry-canvas'}),
);
Inheritance

Constructors

RefNode(Ref<Object> ref, BloomNode child)
Creates a RefNode connecting ref to the primary element emitted by child.
const

Properties

child BloomNode
The child descriptor whose root DOM element will be attached to ref.
final
hashCode int
The hash code for this object.
no setterinherited
ref Ref<Object>
The Ref instance to populate with the mounted DOM element.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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