PortalNode class

Renders child into a target DOM node outside the parent hierarchy while maintaining parent reactive region lifecycle.

DOM Mounting and SSR

  • Browser (mount): Queries the document for targetSelector (defaulting to document.body if unmatched) and appends the mounted DOM nodes of child into that target container. At the original AST position, it leaves a comment node <!-- portal:targetSelector -->. When the parent region is disposed, the portaled DOM nodes are cleaned up from the target container.
  • SSR (renderToHtml): Emits <template data-bloom-portal="targetSelector">child</template> so client-side hydration or inspection tools can relocate portaled content.

Usually created using the DSL sugar Portal.

Inheritance

Constructors

PortalNode({required BloomNode child, String targetSelector = 'body'})
Creates a portal descriptor directing child to targetSelector.
const

Properties

child → BloomNode
The descriptor tree to render into the target container.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
targetSelector → String
The CSS selector identifying the destination container element (e.g. 'body', '#modal-root').
final

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