ApiError class

This is a generic class to handle and display errors across your app. APIError helps you track errors coming from API call and display an error message accordingly. It also maintain the original Exception as well as the stack trace

Inheritance
Implemented types

Constructors

ApiError.fromDio(DioException dio)
Create an ApiError based on a Dio Exception
ApiError.unknown(String? message, [StackTrace? trace])
Create an APIError from a custom error (eg. exception during data processing)
const

Properties

dio DioException?
The DioException originating this error
no setter
hashCode int
The hash code for this object.
no setterinherited
isNoInternetConnectionError bool
no setter
isUnauthenticatedError bool
no setter
message String?
The message from a custom error
no setter
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int
A convenience status code. -1 if unknown and Dio.response.statusCode if available
no setter
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
trace StackTrace?
The stack trace of the error
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited