BloomAsyncBuilder<T> constructor
const
BloomAsyncBuilder<T> ({
- Key? key,
- required Bloom<
T> bloom, - required Bloom<
bool> pending, - required Widget data(
- BuildContext context,
- T data
- required Widget loading(
- BuildContext context
- Widget error(
- BuildContext context,
- Object error,
- StackTrace stackTrace
- Widget empty(
- BuildContext context
- bool preserveDataOnPending = true,
Creates a structured 4-state asynchronous branching widget.
bloom: The upstream reactive Bloom node to observe.pending: Required pending indicator pipeline Bloom<bool> tracking asynchronous activity.data: Builder callback invoked when valid payload data of typeTis present.loading: Builder callback invoked when the node is in uninitialized or loading state.error: Optional builder callback invoked when an error occurs during evaluation.empty: Optional builder callback invoked when data is empty or node is explicitly empty.preserveDataOnPending: Whether to retain prior valid data during background re-evaluation. Defaults totrue.key: Optional widget key.
Requires:
bloom,pending,data, andloadingmust not be null.
Ensures:
- Returns a reactive BloomWidget handling all 4 asynchronous states cleanly with optional SWR retention.
Implementation
const BloomAsyncBuilder({
super.key,
required this.bloom,
required this.pending,
required this.data,
required this.loading,
this.error,
this.empty,
this.preserveDataOnPending = true,
});