ErrorResponse class
Data model which is returned by the backend in case of an error.
Constructors
- ErrorResponse({int? status, String? error, String? message, String? errorType})
- Default constructor
-
ErrorResponse.fromJson(Map<
String, dynamic> json) -
Parses the ErrorResponse model from a given
json
factory - ErrorResponse.noInternet({int? status, String? error = "No Internet", String? message = "Seems like you have no internet connection. Please try again later.", String? errorType = "NO_INTERNET"})
- Constructor that will be used if no internet connection is established
- ErrorResponse.unknown({int? status, String? error = "Unknown error", String? message = "Seems like an unknown error occured.", String? errorType = "UNKNOWN"})
- Constructor that will be used if an unknown error occured
Properties
- error → String?
-
Actual error that occured
final
- errorType → String?
-
Custom type of the error
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- message → String?
-
Message that describes the error
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → int?
-
Status code of the http response
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Transforms the model to a valid json format
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited