Data.fromJson constructor

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

Implementation

Data.fromJson(Map<String, dynamic> json) {
  page = json['page'];
  size = json['size'];
  totalElements = json['totalElements'];
  totalPages = json['totalPages'];
  last = json['last'];
  first = json['first'];
  sort = Sort.fromJson(json['sort']);
  content = List.from(json['content'])
      .map((e) => ProductModel.fromJson(e))
      .toList();
}