fromJson method

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

Implementation

@override
UModEventViewSubject fromJson(Map<String, dynamic> json) {
  try {
    if (isRepoRef(json)) {
      return UModEventViewSubject.repoRef(
        data: const RepoRefConverter().fromJson(json),
      );
    }
    if (isStrongRef(json)) {
      return UModEventViewSubject.strongRef(
        data: const StrongRefConverter().fromJson(json),
      );
    }
    if (isMessageRef(json)) {
      return UModEventViewSubject.messageRef(
        data: const MessageRefConverter().fromJson(json),
      );
    }

    return UModEventViewSubject.unknown(data: json);
  } catch (_) {
    return UModEventViewSubject.unknown(data: json);
  }
}