Search.fromJson constructor Null safety

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

Implementation

Search.fromJson(Map<String, dynamic> json) {
  results = <Results>[];
  if (json['results'] != null) {
    json['results'].forEach((v) {
      results.add(Results.fromJson(v));
    });
  }
  limit = json['limit'] ?? 0;
  offset = json['offset'] ?? 0;
  total = json['total'] ?? 0;
}