fromJson method

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

Implementation

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

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