toJson method
Converts the ResponseModel to a JSON object.
This method can be used when making HTTP requests to convert the response model to a format that can be sent in the request.
Implementation
Map<String, dynamic> toJson() {
Map<String, dynamic> data = <String, dynamic>{};
data["statusCode"] = statusCode;
data["affectedRows"] = affectedRows;
data["message"] = message;
data["data"] = data;
data["extra"] = extra;
if (required != null) {
data["required"] = required!.map((e) => e.toJson()).toList();
}
return data;
}