ChapterInfo.fromJson constructor Null safety

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

Implementation

ChapterInfo.fromJson(Map<String, dynamic> json) {
  chapter = json['chapter'] ?? '';
  id = json['id'] ?? '';
  others = [];
  if (json['others'] != null) {
    json['others'].forEach((e) {
      others.add(e);
    });
  }
  count = json['count'] ?? '';
}