fromMap static method

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

Construct from Map.

Implementation

static InputMessageContent? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  switch (_) {
    case 'inputMessageDice':
      return InputMessageDice.fromMap(_map);
    case 'inputMessageAudio':
      return InputMessageAudio.fromMap(_map);
    case 'inputMessageText':
      return InputMessageText.fromMap(_map);
    case 'inputMessageAnimation':
      return InputMessageAnimation.fromMap(_map);
    case 'inputMessageSticker':
      return InputMessageSticker.fromMap(_map);
    case 'inputMessageStory':
      return InputMessageStory.fromMap(_map);
    case 'inputMessageInvoice':
      return InputMessageInvoice.fromMap(_map);
    case 'inputMessagePhoto':
      return InputMessagePhoto.fromMap(_map);
    case 'inputMessageLocation':
      return InputMessageLocation.fromMap(_map);
    case 'inputMessageForwarded':
      return InputMessageForwarded.fromMap(_map);
    case 'inputMessageVoiceNote':
      return InputMessageVoiceNote.fromMap(_map);
    case 'inputMessageVideo':
      return InputMessageVideo.fromMap(_map);
    case 'inputMessageVenue':
      return InputMessageVenue.fromMap(_map);
    case 'inputMessageDocument':
      return InputMessageDocument.fromMap(_map);
    case 'inputMessageVideoNote':
      return InputMessageVideoNote.fromMap(_map);
    case 'inputMessagePoll':
      return InputMessagePoll.fromMap(_map);
    case 'inputMessageContact':
      return InputMessageContact.fromMap(_map);
    case 'inputMessageGame':
      return InputMessageGame.fromMap(_map);
    case null:
    default:
      return null;
  }
}