ResponseModel class
ResponseModel class represents the response model used in the network layer. It extends the BaseResponse class and contains properties such as entity, error, success, message, and status
Constructors
- ResponseModel({dynamic entity, dynamic error, bool hasMore = false, String? message, int? status, int? statusCode, Failure? errorType})
- Constructs a new ResponseModel instance.
- ResponseModel.fromJson(String source)
-
Constructs a ResponseModel instance from a JSON string.
factory
-
ResponseModel.fromMap(Map<
String, dynamic> map) -
Constructs a ResponseModel instance from a map.
factory
Properties
- entity ↔ dynamic
-
getter/setter pair
- error ↔ dynamic
-
getter/setter pair
- errorMessage ↔ String?
-
getter/setter pairinherited
- errorType ↔ Failure?
-
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasMore ↔ bool
-
getter/setter pair
- message ↔ String?
-
getter/setter pair
- responseStatus ↔ int?
-
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status ↔ int?
-
getter/setter pair
- statusCode ↔ int?
-
getter/setter pairinherited
Methods
-
clearEntity(
) → void -
clearResponse(
) → void -
inherited
-
copyWith(
{dynamic entity, dynamic error, bool? hasMore, String? message, int? status}) → ResponseModel - Creates a copy of the ResponseModel instance with the specified properties overridden.
-
fromJson(
Map< String, dynamic> json) → ResponseModel -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setData<
R> (R entity) → void -
toJson(
) → String - Converts the ResponseModel instance to a JSON string.
-
toMap(
) → Map< String, dynamic> - Converts the ResponseModel instance to a map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited