ResponseStruct.fromJson constructor

ResponseStruct.fromJson(
  1. Map<String, dynamic> parsedJson
)

Implementation

factory ResponseStruct.fromJson(Map<String, dynamic> parsedJson) {
  ResponseStruct res = ResponseStruct();
  res.msg = parsedJson["msg"];
  res.data = parsedJson["data"];
  res.status = parsedJson["status_code"] ?? 0;
  res.currentPage = parsedJson["current_page"] ?? 1;
  res.perPage = parsedJson["per_page"] ?? 1;
  res.totalPages = parsedJson["total_pages"] ?? 1;
  return res;
}