setToHasError method

  1. @override
void setToHasError(
  1. dynamic error, {
  2. StackTrace? stackTrace,
  3. VoidCallback? refresher,
  4. SideEffects<T>? sideEffects,
  5. bool shouldOverrideDefaultSideEffects(
    1. SnapState<T>
    )?,
  6. StateInterceptor<T>? stateInterceptor,
})
override

Set the state to the error status

Implementation

@override
void setToHasError(
  dynamic error, {
  StackTrace? stackTrace,
  VoidCallback? refresher,
  SideEffects<T>? sideEffects,
  bool Function(SnapState<T>)? shouldOverrideDefaultSideEffects,
  StateInterceptor<T>? stateInterceptor,
}) {
  notify(
    nextSnap: _snapState._copyToHasError(
      SnapError(
        error: error,
        stackTrace: stackTrace,
        refresher: refresher ?? () {},
      ),
    ),
    sideEffects: sideEffects,
    shouldOverrideDefaultSideEffects: shouldOverrideDefaultSideEffects,
    stateInterceptor: stateInterceptor,
  );
}