fromJson method
Implementation
@override
UEmbedRecordWithMediaMedia fromJson(Map<String, dynamic> json) {
try {
if (EmbedImages.validate(json)) {
return UEmbedRecordWithMediaMedia.embedImages(
data: const EmbedImagesConverter().fromJson(json),
);
}
if (EmbedVideo.validate(json)) {
return UEmbedRecordWithMediaMedia.embedVideo(
data: const EmbedVideoConverter().fromJson(json),
);
}
if (EmbedExternal.validate(json)) {
return UEmbedRecordWithMediaMedia.embedExternal(
data: const EmbedExternalConverter().fromJson(json),
);
}
return UEmbedRecordWithMediaMedia.unknown(data: json);
} catch (_) {
return UEmbedRecordWithMediaMedia.unknown(data: json);
}
}