fromMap static method

MessageExtendedMedia? fromMap(
  1. Map<String, dynamic>? _map
)
override

Construct from Map.

Implementation

static MessageExtendedMedia? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  switch (_) {
    case 'messageExtendedMediaPreview':
      return MessageExtendedMediaPreview.fromMap(_map);
    case 'messageExtendedMediaUnsupported':
      return MessageExtendedMediaUnsupported.fromMap(_map);
    case 'messageExtendedMediaVideo':
      return MessageExtendedMediaVideo.fromMap(_map);
    case 'messageExtendedMediaPhoto':
      return MessageExtendedMediaPhoto.fromMap(_map);
    case null:
    default:
      return null;
  }
}