fromJson method
Implementation
@override
UEmbedRecordWithMediaViewMedia fromJson(Map<String, dynamic> json) {
try {
if (EmbedImagesView.validate(json)) {
return UEmbedRecordWithMediaViewMedia.embedImagesView(
data: const EmbedImagesViewConverter().fromJson(json),
);
}
if (EmbedVideoView.validate(json)) {
return UEmbedRecordWithMediaViewMedia.embedVideoView(
data: const EmbedVideoViewConverter().fromJson(json),
);
}
if (EmbedExternalView.validate(json)) {
return UEmbedRecordWithMediaViewMedia.embedExternalView(
data: const EmbedExternalViewConverter().fromJson(json),
);
}
return UEmbedRecordWithMediaViewMedia.unknown(data: json);
} catch (_) {
return UEmbedRecordWithMediaViewMedia.unknown(data: json);
}
}