whenOrNull<NewT>  method 
- bool skipLoadingOnReload = false,
- bool skipLoadingOnRefresh = true,
- bool skipError = false,
- NewT? data(- ValueT data
 
- NewT? error(- Object error,
- StackTrace stackTrace
 
- NewT? loading()?,
Perform actions conditionally based on the state of the AsyncValue.
Returns null if AsyncValue was in a state that was not handled.
This is similar to maybeWhen where orElse returns null.
By default, when skips "loading" states if triggered by a Ref.refresh or Ref.invalidate (but does not skip loading states if triggered by Ref.watch).
In the event that an AsyncValue is in multiple states at once (such as
when reloading a provider or emitting an error after a valid data),
when offers various flags to customize whether it should call
loading/error/data :
- 
skipLoadingOnReload(false by default) customizes whetherloadingshould be invoked if a provider rebuilds because of Ref.watch. In that situation, when will try to invoke eithererror/datawith the previous state.
- 
skipLoadingOnRefresh(true by default) controls whetherloadingshould be invoked if a provider rebuilds because of Ref.refresh or Ref.invalidate. In that situation, when will try to invoke eithererror/datawith the previous state.
- 
skipError(false by default) decides whether to invokedatainstead oferrorif a previous value is available.
Implementation
NewT? whenOrNull<NewT>({
  bool skipLoadingOnReload = false,
  bool skipLoadingOnRefresh = true,
  bool skipError = false,
  NewT? Function(ValueT data)? data,
  NewT? Function(Object error, StackTrace stackTrace)? error,
  NewT? Function()? loading,
}) {
  return when(
    skipError: skipError,
    skipLoadingOnRefresh: skipLoadingOnRefresh,
    skipLoadingOnReload: skipLoadingOnReload,
    data: data ?? (_) => null,
    error: error ?? (err, stack) => null,
    loading: loading ?? () => null,
  );
}