maybeMap<TResult extends Object?> method

TResult maybeMap<TResult extends Object?>({
  1. TResult onRampDeposit(
    1. TonWalletTransactionTypeOnRampDeposit value
    )?,
  2. TResult transfer(
    1. TonWalletTransactionTypeTransfer value
    )?,
  3. TResult nftTransfer(
    1. TonWalletTransactionTypeNftTransfer value
    )?,
  4. TResult telegramGiftTransfer(
    1. TonWalletTransactionTypeTelegramGiftTransfer value
    )?,
  5. TResult telegramGiftPurchase(
    1. TonWalletTransactionTypeTelegramGiftPurchase value
    )?,
  6. TResult telegramGiftSale(
    1. TonWalletTransactionTypeTelegramGiftSale value
    )?,
  7. TResult telegramGiftListing(
    1. TonWalletTransactionTypeTelegramGiftListing value
    )?,
  8. TResult telegramGiftDelisting(
    1. TonWalletTransactionTypeTelegramGiftDelisting value
    )?,
  9. TResult telegramGiftOfferCreation(
    1. TonWalletTransactionTypeTelegramGiftOfferCreation value
    )?,
  10. TResult telegramGiftOfferAcceptance(
    1. TonWalletTransactionTypeTelegramGiftOfferAcceptance value
    )?,
  11. TResult telegramGiftOfferCancellation(
    1. TonWalletTransactionTypeTelegramGiftOfferCancellation value
    )?,
  12. TResult telegramGiftOfferDecline(
    1. TonWalletTransactionTypeTelegramGiftOfferDecline value
    )?,
  13. TResult telegramGiftOfferExpiration(
    1. TonWalletTransactionTypeTelegramGiftOfferExpiration value
    )?,
  14. TResult keyChange(
    1. TonWalletTransactionTypeKeyChange value
    )?,
  15. required TResult orElse(),
})

Implementation

TResult maybeMap<TResult extends Object?>({
  TResult Function(TonWalletTransactionTypeOnRampDeposit value)?
      onRampDeposit,
  TResult Function(TonWalletTransactionTypeTransfer value)? transfer,
  TResult Function(TonWalletTransactionTypeNftTransfer value)? nftTransfer,
  TResult Function(TonWalletTransactionTypeTelegramGiftTransfer value)?
      telegramGiftTransfer,
  TResult Function(TonWalletTransactionTypeTelegramGiftPurchase value)?
      telegramGiftPurchase,
  TResult Function(TonWalletTransactionTypeTelegramGiftSale value)?
      telegramGiftSale,
  TResult Function(TonWalletTransactionTypeTelegramGiftListing value)?
      telegramGiftListing,
  TResult Function(TonWalletTransactionTypeTelegramGiftDelisting value)?
      telegramGiftDelisting,
  TResult Function(TonWalletTransactionTypeTelegramGiftOfferCreation value)?
      telegramGiftOfferCreation,
  TResult Function(TonWalletTransactionTypeTelegramGiftOfferAcceptance value)?
      telegramGiftOfferAcceptance,
  TResult Function(
          TonWalletTransactionTypeTelegramGiftOfferCancellation value)?
      telegramGiftOfferCancellation,
  TResult Function(TonWalletTransactionTypeTelegramGiftOfferDecline value)?
      telegramGiftOfferDecline,
  TResult Function(TonWalletTransactionTypeTelegramGiftOfferExpiration value)?
      telegramGiftOfferExpiration,
  TResult Function(TonWalletTransactionTypeKeyChange value)? keyChange,
  required TResult Function() orElse,
}) {
  switch (getConstructor()) {
    case TonWalletTransactionTypeOnRampDeposit.constructor:
      if (onRampDeposit != null) {
        return onRampDeposit
            .call(this as TonWalletTransactionTypeOnRampDeposit);
      }
      break;
    case TonWalletTransactionTypeTransfer.constructor:
      if (transfer != null) {
        return transfer.call(this as TonWalletTransactionTypeTransfer);
      }
      break;
    case TonWalletTransactionTypeNftTransfer.constructor:
      if (nftTransfer != null) {
        return nftTransfer.call(this as TonWalletTransactionTypeNftTransfer);
      }
      break;
    case TonWalletTransactionTypeTelegramGiftTransfer.constructor:
      if (telegramGiftTransfer != null) {
        return telegramGiftTransfer
            .call(this as TonWalletTransactionTypeTelegramGiftTransfer);
      }
      break;
    case TonWalletTransactionTypeTelegramGiftPurchase.constructor:
      if (telegramGiftPurchase != null) {
        return telegramGiftPurchase
            .call(this as TonWalletTransactionTypeTelegramGiftPurchase);
      }
      break;
    case TonWalletTransactionTypeTelegramGiftSale.constructor:
      if (telegramGiftSale != null) {
        return telegramGiftSale
            .call(this as TonWalletTransactionTypeTelegramGiftSale);
      }
      break;
    case TonWalletTransactionTypeTelegramGiftListing.constructor:
      if (telegramGiftListing != null) {
        return telegramGiftListing
            .call(this as TonWalletTransactionTypeTelegramGiftListing);
      }
      break;
    case TonWalletTransactionTypeTelegramGiftDelisting.constructor:
      if (telegramGiftDelisting != null) {
        return telegramGiftDelisting
            .call(this as TonWalletTransactionTypeTelegramGiftDelisting);
      }
      break;
    case TonWalletTransactionTypeTelegramGiftOfferCreation.constructor:
      if (telegramGiftOfferCreation != null) {
        return telegramGiftOfferCreation
            .call(this as TonWalletTransactionTypeTelegramGiftOfferCreation);
      }
      break;
    case TonWalletTransactionTypeTelegramGiftOfferAcceptance.constructor:
      if (telegramGiftOfferAcceptance != null) {
        return telegramGiftOfferAcceptance.call(
            this as TonWalletTransactionTypeTelegramGiftOfferAcceptance);
      }
      break;
    case TonWalletTransactionTypeTelegramGiftOfferCancellation.constructor:
      if (telegramGiftOfferCancellation != null) {
        return telegramGiftOfferCancellation.call(
            this as TonWalletTransactionTypeTelegramGiftOfferCancellation);
      }
      break;
    case TonWalletTransactionTypeTelegramGiftOfferDecline.constructor:
      if (telegramGiftOfferDecline != null) {
        return telegramGiftOfferDecline
            .call(this as TonWalletTransactionTypeTelegramGiftOfferDecline);
      }
      break;
    case TonWalletTransactionTypeTelegramGiftOfferExpiration.constructor:
      if (telegramGiftOfferExpiration != null) {
        return telegramGiftOfferExpiration.call(
            this as TonWalletTransactionTypeTelegramGiftOfferExpiration);
      }
      break;
    case TonWalletTransactionTypeKeyChange.constructor:
      if (keyChange != null) {
        return keyChange.call(this as TonWalletTransactionTypeKeyChange);
      }
      break;
  }
  return orElse.call();
}