ReportReason.fromJson constructor

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

Implementation

factory ReportReason.fromJson(Map<String, dynamic> json) {
  switch (json["@type"]) {
    case ReportReasonSpam.CONSTRUCTOR:
      return ReportReasonSpam.fromJson(json);
    case ReportReasonViolence.CONSTRUCTOR:
      return ReportReasonViolence.fromJson(json);
    case ReportReasonPornography.CONSTRUCTOR:
      return ReportReasonPornography.fromJson(json);
    case ReportReasonChildAbuse.CONSTRUCTOR:
      return ReportReasonChildAbuse.fromJson(json);
    case ReportReasonCopyright.CONSTRUCTOR:
      return ReportReasonCopyright.fromJson(json);
    case ReportReasonUnrelatedLocation.CONSTRUCTOR:
      return ReportReasonUnrelatedLocation.fromJson(json);
    case ReportReasonFake.CONSTRUCTOR:
      return ReportReasonFake.fromJson(json);
    case ReportReasonIllegalDrugs.CONSTRUCTOR:
      return ReportReasonIllegalDrugs.fromJson(json);
    case ReportReasonPersonalDetails.CONSTRUCTOR:
      return ReportReasonPersonalDetails.fromJson(json);
    case ReportReasonCustom.CONSTRUCTOR:
      return ReportReasonCustom.fromJson(json);
    default:
      return const ReportReason();
  }
}