ChapterData.fromJson constructor Null safety

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

Implementation

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