ResponseModel class
Represents the standard response structure from a server or an API endpoint.
This model consists of two key properties: result and reason. It is typically used to standardize the communication between a client and a server.
Constructors
- ResponseModel({required bool result, required String reason})
- Constructs a new instance of the ResponseModel class.
-
ResponseModel.fromJson(Map<
String, dynamic> json) -
Creates a new instance of the ResponseModel class from a JSON map.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- reason → String
-
A string providing more detailed information about the operation's outcome.
final
- result → bool
-
A boolean flag indicating the outcome of the operation.
final
- 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
-
toJson(
) → Map< String, dynamic> - Converts the current instance of the ResponseModel class into a JSON map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited