when<R> method
R
when<R>({
- required R notInitialized(),
- required R inProgress(
- CancelableOperation<
T> operation
- CancelableOperation<
- required R ready(
- T value
- required R failed(
- Object exception
Implementation
R when<R>({
required R Function() notInitialized,
required R Function(CancelableOperation<T> operation) inProgress,
required R Function(T value) ready,
required R Function(Object exception) failed,
}) {
return maybeWhen(
notInitialized: notInitialized,
inProgress: inProgress,
ready: ready,
failed: failed,
orElse: () {
throw StateError('Invalid ComputedStateValue descendant');
},
);
}