fromJson method
Implementation
@override
UThreadItemValue fromJson(Map<String, dynamic> json) {
try {
if (ThreadItemPost.validate(json)) {
return UThreadItemValue.threadItemPost(
data: const ThreadItemPostConverter().fromJson(json),
);
}
if (ThreadItemNoUnauthenticated.validate(json)) {
return UThreadItemValue.threadItemNoUnauthenticated(
data: const ThreadItemNoUnauthenticatedConverter().fromJson(json),
);
}
if (ThreadItemNotFound.validate(json)) {
return UThreadItemValue.threadItemNotFound(
data: const ThreadItemNotFoundConverter().fromJson(json),
);
}
if (ThreadItemBlocked.validate(json)) {
return UThreadItemValue.threadItemBlocked(
data: const ThreadItemBlockedConverter().fromJson(json),
);
}
return UThreadItemValue.unknown(data: json);
} catch (_) {
return UThreadItemValue.unknown(data: json);
}
}