AsyncState<S extends Object?>.error constructor

AsyncState<S extends Object?>.error(
  1. Object error, {
  2. String? message,
  3. StackTrace? stackTrace,
})

Creates an error state with the given error information.

error is the error object or exception that occurred. message is an optional error message for display. stackTrace is an optional stack trace for debugging.

Use this when the asynchronous operation has failed and you want to provide error details.

Implementation

AsyncState.error(
  Object error, {
  String? message,
  StackTrace? stackTrace,
}) : super.error(ErrorState(error, message: message, stackTrace: stackTrace));