fromJson method

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

Implementation

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

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