fromJson method
Implementation
@override
Consent fromJson(Map<String, dynamic> json) {
final categoryPreferences = json['categoryPreferences'];
if (categoryPreferences is! Map) {
return Consent(categoryPreferences: ConsentCategoryPreferences());
}
return Consent.fromJson({
...json,
'categoryPreferences': Map<String, dynamic>.from(categoryPreferences),
});
}