copyWithPrevious method

  1. @override
AsyncData<T> copyWithPrevious(
  1. AsyncValue<T> previous, {
  2. bool isRefresh = true,
})
override

Clone an AsyncValue, merging it with previous.

When doing so, the resulting AsyncValue can contain the information about multiple state at once. For example, this allows an AsyncError to contain a value, or even AsyncLoading to contain both a value and an error.

The optional isRefresh flag (true by default) represents whether the provider rebuilt by Ref.refresh/Ref.invalidate (if true) or instead by Ref.watch (if false). This changes the default behavior of when and sets the isReloading/ isRefreshing flags accordingly.

Implementation

@override
AsyncData<T> copyWithPrevious(
  AsyncValue<T> previous, {
  bool isRefresh = true,
}) {
  return this;
}