MessageExtendedMedia.fromJson constructor

MessageExtendedMedia.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory MessageExtendedMedia.fromJson(Map<String, dynamic> json) {
  switch (json["@type"]) {
    case MessageExtendedMediaPreview.CONSTRUCTOR:
      return MessageExtendedMediaPreview.fromJson(json);
    case MessageExtendedMediaPhoto.CONSTRUCTOR:
      return MessageExtendedMediaPhoto.fromJson(json);
    case MessageExtendedMediaVideo.CONSTRUCTOR:
      return MessageExtendedMediaVideo.fromJson(json);
    case MessageExtendedMediaUnsupported.CONSTRUCTOR:
      return MessageExtendedMediaUnsupported.fromJson(json);
    default:
      return const MessageExtendedMedia();
  }
}