fromJson method

  1. @override
Consent fromJson(
  1. Map<String, dynamic> json
)
override

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),
  });
}