ResponseModel.fromJson constructor

ResponseModel.fromJson(
  1. Map<String, dynamic> json
)

Creates a new instance of ResponseModel from a JSON object.

This method extracts the properties from the json parameter and uses them to initialize a new instance of ResponseModel.

Implementation

ResponseModel.fromJson(Map<String, dynamic> json) {
  statusCode = json['statusCode'];
  message = json['message'];
  data = json['data'];
  affectedRows = json['affectedRows'];
  extra = json['extra'];
  if (json['required'] != null) {
    required = <ValidationErrorModel>[];
    json['required'].forEach((v) {
      required!.add(ValidationErrorModel.fromJson(v));
    });
  }
}