Categories.fromJson constructor Null safety
Implementation
Categories.fromJson(Map<String, dynamic> json) {
if (json['trivia_categories'] != null) {
triviaCategories = <TriviaCategories>[];
json['trivia_categories'].forEach((v) {
triviaCategories!.add(TriviaCategories.fromJson(v));
});
}
}