when<R> method
R
when<R>({
- required R initial(),
- required R loading(),
- required R success(
- T data
- required R error(
- Object? err,
- StackTrace? stackTrace
Implementation
@protected
R when<R>({
required R Function() initial,
required R Function() loading,
required R Function(T data) success,
required R Function(Object? err, StackTrace? stackTrace) error,
}) {
return _state.when(
initial: initial,
loading: loading,
success: (infoData) => success(infoData),
error: error,
);
}