ResponseModel class
Basic model in root of every Response
, containing success status,
message and also data that extends DModel class.
ResponseModel(
success: true,
message: 'Successfully Fetching Data!',
data: const ResponseDataModel());
Constructors
-
ResponseModel({bool success = false, String message = 'No Message', JSON? data, List<
LinkModel> links = const []}) -
Default constructor of ResponseModel with value
success
isfalse
,message
isNo Message
, anddata
is DModel.const
Properties
- data → JSON?
-
Child data of ResponseModel, must be a class that extends
DModel.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
links
→ List<
LinkModel> -
List of reference link of this model.
final
- message → String
-
A short description of Response success status.
final
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true
, thetoString
method will be overridden to output this instance'sprops
.no setterinherited - success → bool
-
Success status of whether the response is what is expected or not.
final
- toJSON ↔ JSON
-
Convert this DModel to JSON.
getter/setter pairinherited-setteroverride-getter
Methods
-
copyWith(
{bool? success, String? message, JSON? data, List< LinkModel> ? links}) → ResponseModel -
Copy variables in this DModel and make a new one out of it.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromJSON<
T extends DModel> (JSON value) → ResponseModel -
Convert a JSON to this DModel.
override