ErrorBoundary class

DSL sugar for ErrorBoundaryNode.

Protects the application UI from crashing due to exceptions in child components or nested reactive rebuilds.

BloomNode safeDashboard() => ErrorBoundary(
  builder: () => Div(
    children: [
      H1(text: 'Analytics'),
      riskyAnalyticsWidget(),
    ],
  ),
  fallback: (error, stack) => Div(
    className: 'error-banner',
    text: 'Failed to load dashboard: $error',
  ),
);
Inheritance

Constructors

ErrorBoundary({required BloomNode builder(), required BloomNode fallback(Object error, StackTrace stackTrace)})
Creates an error boundary wrapping builder with fallback.
const

Properties

builder BloomNode Function()
Factory building the primary subtree.
finalinherited
fallback BloomNode Function(Object error, StackTrace stackTrace)
Fallback builder invoked with the caught Object error and StackTrace when builder fails.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
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