copyTo method

SnapState<T> copyTo({
  1. bool? isWaiting,
  2. bool? isIdle,
  3. bool? isActive,
  4. T? data,
  5. dynamic error,
  6. StackTrace? stackTrace,
})

Implementation

SnapState<T> copyTo({
  bool? isWaiting,
  bool? isIdle,
  bool? isActive,
  T? data,
  dynamic error,
  StackTrace? stackTrace,
}) {
  if (isWaiting != null) {
    return _copyToIsWaiting();
  }
  if (error != null) {
    return _copyToHasError(error, () {}, stackTrace: stackTrace);
  }
  if (isIdle != null) {
    return _copyToIsIdle();
  }
  if (isActive != null) {
    return _copyWith(isActive: isActive);
  }

  return _copyToHasData(data);
}