CustomMetadata.fromJson constructor

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

Implementation

factory CustomMetadata.fromJson(Map<String, dynamic> json) {
  Map<String, dynamic> colorJson = json["color"];
  Map<String, dynamic> extraJson = json["extra"];
  Map<String, dynamic> iconsJson = json["icons"];
  Map<String, dynamic> personalizationJson = json["personalization"];
  List<dynamic> formJsonList = json["form"];

  return CustomMetadata(
      applicationId: json["applicationid"] ?? 0,
      integrationId: json["integrationid"] ?? 0,
      color: ColorPreference.fromJson(colorJson),
      extra: Extra.fromJson(extraJson),
      icons: IconsPreference.fromJson(iconsJson),
      personalization: Personalization.fromJson(personalizationJson),
      form: formJsonList.map((e) => FormField.fromJson(e)).toList());
}