ApiResponse class

API response model

Constructors

ApiResponse.new({required bool success, dynamic data, String? error, int? statusCode})
Constructor

Properties

data → dynamic
Response data (if successful)
final
error String?
Error message (if unsuccessful)
final
fileName String?
Get the file name from the response
no setter
fileUrl String?
Get the file URL from the response
no setter
hashCode int
The hash code for this object.
no setterinherited
isAuthError bool
Check if there was an authentication error
no setter
isRateLimitError bool
Check if there was a rate limit error
no setter
isServerError bool
Check if there was a server error
no setter
message String?
Get a message from the response
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int?
HTTP status code
final
success bool
Whether the request was successful
final
userFriendlyError String
Get a user-friendly error message
no setter

Methods

getField<T>(String fieldName) → T?
Get a specific field from the data
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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