fromJson method
Implementation
@override
UReplyRefRoot fromJson(Map<String, dynamic> json) {
try {
if (isPostView(json)) {
return UReplyRefRoot.postView(
data: const PostViewConverter().fromJson(json),
);
}
if (isNotFoundPost(json)) {
return UReplyRefRoot.notFoundPost(
data: const NotFoundPostConverter().fromJson(json),
);
}
if (isBlockedPost(json)) {
return UReplyRefRoot.blockedPost(
data: const BlockedPostConverter().fromJson(json),
);
}
return UReplyRefRoot.unknown(data: json);
} catch (_) {
return UReplyRefRoot.unknown(data: json);
}
}