onOrElse<R> method Null safety

R onOrElse<R>(
  1. {R onIdle(
      )?,
    1. R onWaiting(
        )?,
      1. R onError(
        1. dynamic error,
        2. VoidCallback refreshError
        )?,
      2. R onData(
        1. T data
        )?,
      3. required R orElse(
        1. T data
        )}
      )
      inherited

      Implementation

      R onOrElse<R>({
        R Function()? onIdle,
        R Function()? onWaiting,
        R Function(dynamic error, VoidCallback refreshError)? onError,
        R Function(T data)? onData,
        required R Function(T data) orElse,
      }) {
        OnReactiveState.addToObs?.call(this);
        return _reactiveModelState.snapState.onOrElse<R>(
          onIdle: onIdle,
          onWaiting: onWaiting,
          onError: onError,
          orElse: orElse,
        );
      }