whenConnectionState<R> method

  1. @Deprecated('Use onAll instead')
R whenConnectionState<R>({
  1. R onIdle()?,
  2. required R onWaiting()?,
  3. required R onError(
    1. dynamic error
    )?,
  4. required R onData(
    1. T data
    ),
})

Implementation

@Deprecated('Use onAll instead')
// ignore: public_member_api_docs
R whenConnectionState<R>({
  R Function()? onIdle,
  required R Function()? onWaiting,
  required R Function(dynamic error)? onError,
  required R Function(T data) onData,
}) {
  return onAll<R>(
    onIdle: onIdle,
    onWaiting: onWaiting,
    onError: onError != null ? (_, __) => onError(_) : null,
    onData: onData,
  );
}