fromMap static method

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

Construct from Map.

Implementation

static PushMessageContent? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  switch (_) {
    case 'pushMessageContentChatChangeTitle':
      return PushMessageContentChatChangeTitle.fromMap(_map);
    case 'pushMessageContentInvoice':
      return PushMessageContentInvoice.fromMap(_map);
    case 'pushMessageContentAnimation':
      return PushMessageContentAnimation.fromMap(_map);
    case 'pushMessageContentStory':
      return PushMessageContentStory.fromMap(_map);
    case 'pushMessageContentChatSetBackground':
      return PushMessageContentChatSetBackground.fromMap(_map);
    case 'pushMessageContentGame':
      return PushMessageContentGame.fromMap(_map);
    case 'pushMessageContentDocument':
      return PushMessageContentDocument.fromMap(_map);
    case 'pushMessageContentPhoto':
      return PushMessageContentPhoto.fromMap(_map);
    case 'pushMessageContentGameScore':
      return PushMessageContentGameScore.fromMap(_map);
    case 'pushMessageContentLocation':
      return PushMessageContentLocation.fromMap(_map);
    case 'pushMessageContentChatJoinByRequest':
      return PushMessageContentChatJoinByRequest.fromMap(_map);
    case 'pushMessageContentContact':
      return PushMessageContentContact.fromMap(_map);
    case 'pushMessageContentRecurringPayment':
      return PushMessageContentRecurringPayment.fromMap(_map);
    case 'pushMessageContentSuggestProfilePhoto':
      return PushMessageContentSuggestProfilePhoto.fromMap(_map);
    case 'pushMessageContentMessageForwards':
      return PushMessageContentMessageForwards.fromMap(_map);
    case 'pushMessageContentMediaAlbum':
      return PushMessageContentMediaAlbum.fromMap(_map);
    case 'pushMessageContentVideo':
      return PushMessageContentVideo.fromMap(_map);
    case 'pushMessageContentBasicGroupChatCreate':
      return PushMessageContentBasicGroupChatCreate.fromMap(_map);
    case 'pushMessageContentAudio':
      return PushMessageContentAudio.fromMap(_map);
    case 'pushMessageContentHidden':
      return PushMessageContentHidden.fromMap(_map);
    case 'pushMessageContentChatDeleteMember':
      return PushMessageContentChatDeleteMember.fromMap(_map);
    case 'pushMessageContentSticker':
      return PushMessageContentSticker.fromMap(_map);
    case 'pushMessageContentPoll':
      return PushMessageContentPoll.fromMap(_map);
    case 'pushMessageContentVoiceNote':
      return PushMessageContentVoiceNote.fromMap(_map);
    case 'pushMessageContentContactRegistered':
      return PushMessageContentContactRegistered.fromMap(_map);
    case 'pushMessageContentVideoNote':
      return PushMessageContentVideoNote.fromMap(_map);
    case 'pushMessageContentChatSetTheme':
      return PushMessageContentChatSetTheme.fromMap(_map);
    case 'pushMessageContentChatChangePhoto':
      return PushMessageContentChatChangePhoto.fromMap(_map);
    case 'pushMessageContentChatJoinByLink':
      return PushMessageContentChatJoinByLink.fromMap(_map);
    case 'pushMessageContentText':
      return PushMessageContentText.fromMap(_map);
    case 'pushMessageContentChatAddMembers':
      return PushMessageContentChatAddMembers.fromMap(_map);
    case 'pushMessageContentScreenshotTaken':
      return PushMessageContentScreenshotTaken.fromMap(_map);
    case null:
    default:
      return null;
  }
}