Mount class

DSL sugar for MountNode.

Attaches lifecycle hooks to child for browser DOM mount and unmount events.

BloomNode timerWidget() => Mount(
  Div(text: 'Timer active'),
  onMount: () {
    print('Widget entered the DOM');
  },
  onUnmount: () {
    print('Widget left the DOM');
  },
);
Inheritance

Constructors

Mount(BloomNode child, {void onMount()?, void onUnmount()?})
Creates a lifecycle boundary wrapping child with optional onMount and onUnmount hooks.
const

Properties

child → BloomNode
The child descriptor tree enclosed by this lifecycle boundary.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
onMount → void Function()?
Callback executed asynchronously in a microtask after child is inserted into the DOM.
finalinherited
onUnmount → void Function()?
Callback executed synchronously when child is removed from the DOM.
finalinherited
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