ResponseDto<T> class

Data Transfer Object for Response.

Extends Response and adds serialization/deserialization functionality.

Inheritance

Constructors

ResponseDto({T? data, ErrorData? error, int balance = 0})
Creates a new ResponseDto instance.
ResponseDto.fromJson(String json)
Creates a ResponseDto from a JSON string.
factory
ResponseDto.fromMap(Map<String, dynamic> map)
Creates a ResponseDto from a map.
factory

Properties

balance int
The current account balance.
finalinherited
data → T?
The response data of type T, if the request was successful.
finalinherited
error ErrorData?
The error information, if the request failed.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
isError bool
Returns true if the response contains an error.
no setterinherited
isSuccess bool
Returns true if the response was successful (has data and no error).
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toResponse<R>() Response<R>
Converts this ResponseDto to a Response with a different data type.
toString() String
A string representation of this object.
inherited

Operators

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