ApiResponse<T>.fromJson constructor
ApiResponse<T>.fromJson(
- Map<String, dynamic> json,
- T fromJsonT(
- Object? json
)
)
Implementation
factory ApiResponse.fromJson(
Map<String, dynamic> json,
T Function(Object? json) fromJsonT,
) {
return ApiResponse<T>(
data: json['data'] != null ? fromJsonT(json['data']) : null,
results: json['results'] != null ? fromJsonT(json['results']) : null,
status: json['status'],
message: json['message'],
count: json['count'],
next: json['next'],
previous: json['previous'],
currentPage: json['current_page'],
itemsPerPage: json['items_per_page'],
totalItems: json['total_items'],
isLastPage: json['is_last_page'],
);
}