copyToHasError method

SnapState<T> copyToHasError(
  1. dynamic error, {
  2. StackTrace? stackTrace,
  3. VoidCallback? refresher,
})

Copy the state to a new state in the error status

Implementation

SnapState<T> copyToHasError(
  dynamic error, {
  StackTrace? stackTrace,
  VoidCallback? refresher,
}) {
  return copyWith(
    status: StateStatus.hasError,
    error: SnapError(
      error: error,
      stackTrace: stackTrace,
      refresher: refresher ?? () {},
    ),
    infoMessage: '',
  );
}