Bloom<T>.error constructor
Bloom<T>.error (
- Object error, [
- StackTrace? stackTrace
Creates a constant static leaf node permanently in an Error state.
error: The exception or error payload.stackTrace: Optional stack trace associated with the failure.
Ensures:
- Returns a leaf Bloom node permanently in the Error state (BloomState.hasError == true).
Examples
final failedNode = Bloom<int>.error(StateError('Resource offline'));
print(untracked.state(failedNode).hasError); // true
Implementation
factory Bloom.error(Object error, [StackTrace? stackTrace]) = _ConstantBloom<T>.error;