Show class

Conditional rendering sugar.

Mounts child when when returns true, or fallback when false.

DOM Representation

Mounts between sentinel comments <!-- bloom:show --> and <!-- /bloom:show -->.

final isLoggedIn = signal(false);

BloomNode authSection() => Show(
  () => isLoggedIn.value,
  child: Button(
    text: 'Log out',
    onClick: (e) => isLoggedIn.value = false,
  ),
  fallback: Button(
    text: 'Log in',
    onClick: (e) => isLoggedIn.value = true,
  ),
);
Inheritance

Constructors

Show(bool when(), {required BloomNode child, BloomNode? fallback})
Creates a conditional rendering boundary with predicate when, child, and optional fallback.
const

Properties

child BloomNode
The descriptor tree rendered when when evaluates to true.
finalinherited
fallback BloomNode?
Optional descriptor tree rendered when when evaluates to false.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
when bool Function()
Reactive predicate — called inside a signals effect (browser) or once (SSR).
finalinherited

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