maybeMap<TResult extends Object?> method

TResult maybeMap<TResult extends Object?>({
  1. TResult cancel(
    1. ChatActionCancel value
    )?,
  2. TResult choosingContact(
    1. ChatActionChoosingContact value
    )?,
  3. TResult choosingLocation(
    1. ChatActionChoosingLocation value
    )?,
  4. TResult choosingSticker(
    1. ChatActionChoosingSticker value
    )?,
  5. TResult recordingVideo(
    1. ChatActionRecordingVideo value
    )?,
  6. TResult recordingVideoNote(
    1. ChatActionRecordingVideoNote value
    )?,
  7. TResult recordingVoiceNote(
    1. ChatActionRecordingVoiceNote value
    )?,
  8. TResult startPlayingGame(
    1. ChatActionStartPlayingGame value
    )?,
  9. TResult typing(
    1. ChatActionTyping value
    )?,
  10. TResult uploadingDocument(
    1. ChatActionUploadingDocument value
    )?,
  11. TResult uploadingPhoto(
    1. ChatActionUploadingPhoto value
    )?,
  12. TResult uploadingVideo(
    1. ChatActionUploadingVideo value
    )?,
  13. TResult uploadingVideoNote(
    1. ChatActionUploadingVideoNote value
    )?,
  14. TResult uploadingVoiceNote(
    1. ChatActionUploadingVoiceNote value
    )?,
  15. TResult watchingAnimations(
    1. ChatActionWatchingAnimations value
    )?,
  16. required TResult orElse(),
})

Implementation

TResult maybeMap<TResult extends Object?>({
  TResult Function(ChatActionCancel value)? cancel,
  TResult Function(ChatActionChoosingContact value)? choosingContact,
  TResult Function(ChatActionChoosingLocation value)? choosingLocation,
  TResult Function(ChatActionChoosingSticker value)? choosingSticker,
  TResult Function(ChatActionRecordingVideo value)? recordingVideo,
  TResult Function(ChatActionRecordingVideoNote value)? recordingVideoNote,
  TResult Function(ChatActionRecordingVoiceNote value)? recordingVoiceNote,
  TResult Function(ChatActionStartPlayingGame value)? startPlayingGame,
  TResult Function(ChatActionTyping value)? typing,
  TResult Function(ChatActionUploadingDocument value)? uploadingDocument,
  TResult Function(ChatActionUploadingPhoto value)? uploadingPhoto,
  TResult Function(ChatActionUploadingVideo value)? uploadingVideo,
  TResult Function(ChatActionUploadingVideoNote value)? uploadingVideoNote,
  TResult Function(ChatActionUploadingVoiceNote value)? uploadingVoiceNote,
  TResult Function(ChatActionWatchingAnimations value)? watchingAnimations,
  required TResult Function() orElse,
}) {
  switch (getConstructor()) {
    case ChatActionCancel.constructor:
      if (cancel != null) {
        return cancel.call(this as ChatActionCancel);
      }
      break;
    case ChatActionChoosingContact.constructor:
      if (choosingContact != null) {
        return choosingContact.call(this as ChatActionChoosingContact);
      }
      break;
    case ChatActionChoosingLocation.constructor:
      if (choosingLocation != null) {
        return choosingLocation.call(this as ChatActionChoosingLocation);
      }
      break;
    case ChatActionChoosingSticker.constructor:
      if (choosingSticker != null) {
        return choosingSticker.call(this as ChatActionChoosingSticker);
      }
      break;
    case ChatActionRecordingVideo.constructor:
      if (recordingVideo != null) {
        return recordingVideo.call(this as ChatActionRecordingVideo);
      }
      break;
    case ChatActionRecordingVideoNote.constructor:
      if (recordingVideoNote != null) {
        return recordingVideoNote.call(this as ChatActionRecordingVideoNote);
      }
      break;
    case ChatActionRecordingVoiceNote.constructor:
      if (recordingVoiceNote != null) {
        return recordingVoiceNote.call(this as ChatActionRecordingVoiceNote);
      }
      break;
    case ChatActionStartPlayingGame.constructor:
      if (startPlayingGame != null) {
        return startPlayingGame.call(this as ChatActionStartPlayingGame);
      }
      break;
    case ChatActionTyping.constructor:
      if (typing != null) {
        return typing.call(this as ChatActionTyping);
      }
      break;
    case ChatActionUploadingDocument.constructor:
      if (uploadingDocument != null) {
        return uploadingDocument.call(this as ChatActionUploadingDocument);
      }
      break;
    case ChatActionUploadingPhoto.constructor:
      if (uploadingPhoto != null) {
        return uploadingPhoto.call(this as ChatActionUploadingPhoto);
      }
      break;
    case ChatActionUploadingVideo.constructor:
      if (uploadingVideo != null) {
        return uploadingVideo.call(this as ChatActionUploadingVideo);
      }
      break;
    case ChatActionUploadingVideoNote.constructor:
      if (uploadingVideoNote != null) {
        return uploadingVideoNote.call(this as ChatActionUploadingVideoNote);
      }
      break;
    case ChatActionUploadingVoiceNote.constructor:
      if (uploadingVoiceNote != null) {
        return uploadingVoiceNote.call(this as ChatActionUploadingVoiceNote);
      }
      break;
    case ChatActionWatchingAnimations.constructor:
      if (watchingAnimations != null) {
        return watchingAnimations.call(this as ChatActionWatchingAnimations);
      }
      break;
  }
  return orElse.call();
}