maybeMap<TResult extends Object?> method

TResult maybeMap<TResult extends Object?>({
  1. TResult animation(
    1. FileTypeAnimation value
    )?,
  2. TResult audio(
    1. FileTypeAudio value
    )?,
  3. TResult document(
    1. FileTypeDocument value
    )?,
  4. TResult livePhotoVideo(
    1. FileTypeLivePhotoVideo value
    )?,
  5. TResult none(
    1. FileTypeNone value
    )?,
  6. TResult notificationSound(
    1. FileTypeNotificationSound value
    )?,
  7. TResult photo(
    1. FileTypePhoto value
    )?,
  8. TResult photoStory(
    1. FileTypePhotoStory value
    )?,
  9. TResult profilePhoto(
    1. FileTypeProfilePhoto value
    )?,
  10. TResult secret(
    1. FileTypeSecret value
    )?,
  11. TResult secretThumbnail(
    1. FileTypeSecretThumbnail value
    )?,
  12. TResult secure(
    1. FileTypeSecure value
    )?,
  13. TResult selfDestructingLivePhotoVideo(
    1. FileTypeSelfDestructingLivePhotoVideo value
    )?,
  14. TResult selfDestructingPhoto(
    1. FileTypeSelfDestructingPhoto value
    )?,
  15. TResult selfDestructingVideo(
    1. FileTypeSelfDestructingVideo value
    )?,
  16. TResult selfDestructingVideoNote(
    1. FileTypeSelfDestructingVideoNote value
    )?,
  17. TResult selfDestructingVoiceNote(
    1. FileTypeSelfDestructingVoiceNote value
    )?,
  18. TResult sticker(
    1. FileTypeSticker value
    )?,
  19. TResult thumbnail(
    1. FileTypeThumbnail value
    )?,
  20. TResult unknown(
    1. FileTypeUnknown value
    )?,
  21. TResult video(
    1. FileTypeVideo value
    )?,
  22. TResult videoNote(
    1. FileTypeVideoNote value
    )?,
  23. TResult videoStory(
    1. FileTypeVideoStory value
    )?,
  24. TResult voiceNote(
    1. FileTypeVoiceNote value
    )?,
  25. TResult wallpaper(
    1. FileTypeWallpaper value
    )?,
  26. required TResult orElse(),
})

Implementation

TResult maybeMap<TResult extends Object?>({
  TResult Function(FileTypeAnimation value)? animation,
  TResult Function(FileTypeAudio value)? audio,
  TResult Function(FileTypeDocument value)? document,
  TResult Function(FileTypeLivePhotoVideo value)? livePhotoVideo,
  TResult Function(FileTypeNone value)? none,
  TResult Function(FileTypeNotificationSound value)? notificationSound,
  TResult Function(FileTypePhoto value)? photo,
  TResult Function(FileTypePhotoStory value)? photoStory,
  TResult Function(FileTypeProfilePhoto value)? profilePhoto,
  TResult Function(FileTypeSecret value)? secret,
  TResult Function(FileTypeSecretThumbnail value)? secretThumbnail,
  TResult Function(FileTypeSecure value)? secure,
  TResult Function(FileTypeSelfDestructingLivePhotoVideo value)?
  selfDestructingLivePhotoVideo,
  TResult Function(FileTypeSelfDestructingPhoto value)? selfDestructingPhoto,
  TResult Function(FileTypeSelfDestructingVideo value)? selfDestructingVideo,
  TResult Function(FileTypeSelfDestructingVideoNote value)?
  selfDestructingVideoNote,
  TResult Function(FileTypeSelfDestructingVoiceNote value)?
  selfDestructingVoiceNote,
  TResult Function(FileTypeSticker value)? sticker,
  TResult Function(FileTypeThumbnail value)? thumbnail,
  TResult Function(FileTypeUnknown value)? unknown,
  TResult Function(FileTypeVideo value)? video,
  TResult Function(FileTypeVideoNote value)? videoNote,
  TResult Function(FileTypeVideoStory value)? videoStory,
  TResult Function(FileTypeVoiceNote value)? voiceNote,
  TResult Function(FileTypeWallpaper value)? wallpaper,
  required TResult Function() orElse,
}) {
  switch (getConstructor()) {
    case FileTypeAnimation.constructor:
      if (animation != null) {
        return animation.call(this as FileTypeAnimation);
      }
      break;
    case FileTypeAudio.constructor:
      if (audio != null) {
        return audio.call(this as FileTypeAudio);
      }
      break;
    case FileTypeDocument.constructor:
      if (document != null) {
        return document.call(this as FileTypeDocument);
      }
      break;
    case FileTypeLivePhotoVideo.constructor:
      if (livePhotoVideo != null) {
        return livePhotoVideo.call(this as FileTypeLivePhotoVideo);
      }
      break;
    case FileTypeNone.constructor:
      if (none != null) {
        return none.call(this as FileTypeNone);
      }
      break;
    case FileTypeNotificationSound.constructor:
      if (notificationSound != null) {
        return notificationSound.call(this as FileTypeNotificationSound);
      }
      break;
    case FileTypePhoto.constructor:
      if (photo != null) {
        return photo.call(this as FileTypePhoto);
      }
      break;
    case FileTypePhotoStory.constructor:
      if (photoStory != null) {
        return photoStory.call(this as FileTypePhotoStory);
      }
      break;
    case FileTypeProfilePhoto.constructor:
      if (profilePhoto != null) {
        return profilePhoto.call(this as FileTypeProfilePhoto);
      }
      break;
    case FileTypeSecret.constructor:
      if (secret != null) {
        return secret.call(this as FileTypeSecret);
      }
      break;
    case FileTypeSecretThumbnail.constructor:
      if (secretThumbnail != null) {
        return secretThumbnail.call(this as FileTypeSecretThumbnail);
      }
      break;
    case FileTypeSecure.constructor:
      if (secure != null) {
        return secure.call(this as FileTypeSecure);
      }
      break;
    case FileTypeSelfDestructingLivePhotoVideo.constructor:
      if (selfDestructingLivePhotoVideo != null) {
        return selfDestructingLivePhotoVideo.call(
          this as FileTypeSelfDestructingLivePhotoVideo,
        );
      }
      break;
    case FileTypeSelfDestructingPhoto.constructor:
      if (selfDestructingPhoto != null) {
        return selfDestructingPhoto.call(
          this as FileTypeSelfDestructingPhoto,
        );
      }
      break;
    case FileTypeSelfDestructingVideo.constructor:
      if (selfDestructingVideo != null) {
        return selfDestructingVideo.call(
          this as FileTypeSelfDestructingVideo,
        );
      }
      break;
    case FileTypeSelfDestructingVideoNote.constructor:
      if (selfDestructingVideoNote != null) {
        return selfDestructingVideoNote.call(
          this as FileTypeSelfDestructingVideoNote,
        );
      }
      break;
    case FileTypeSelfDestructingVoiceNote.constructor:
      if (selfDestructingVoiceNote != null) {
        return selfDestructingVoiceNote.call(
          this as FileTypeSelfDestructingVoiceNote,
        );
      }
      break;
    case FileTypeSticker.constructor:
      if (sticker != null) {
        return sticker.call(this as FileTypeSticker);
      }
      break;
    case FileTypeThumbnail.constructor:
      if (thumbnail != null) {
        return thumbnail.call(this as FileTypeThumbnail);
      }
      break;
    case FileTypeUnknown.constructor:
      if (unknown != null) {
        return unknown.call(this as FileTypeUnknown);
      }
      break;
    case FileTypeVideo.constructor:
      if (video != null) {
        return video.call(this as FileTypeVideo);
      }
      break;
    case FileTypeVideoNote.constructor:
      if (videoNote != null) {
        return videoNote.call(this as FileTypeVideoNote);
      }
      break;
    case FileTypeVideoStory.constructor:
      if (videoStory != null) {
        return videoStory.call(this as FileTypeVideoStory);
      }
      break;
    case FileTypeVoiceNote.constructor:
      if (voiceNote != null) {
        return voiceNote.call(this as FileTypeVoiceNote);
      }
      break;
    case FileTypeWallpaper.constructor:
      if (wallpaper != null) {
        return wallpaper.call(this as FileTypeWallpaper);
      }
      break;
  }
  return orElse.call();
}