maybeMap<TResult extends Object?> method

TResult maybeMap<TResult extends Object?>({
  1. TResult backdrop(
    1. UpgradedGiftAttributeIdBackdrop value
    )?,
  2. TResult model(
    1. UpgradedGiftAttributeIdModel value
    )?,
  3. TResult symbol(
    1. UpgradedGiftAttributeIdSymbol value
    )?,
  4. required TResult orElse(),
})

Implementation

TResult maybeMap<TResult extends Object?>({
  TResult Function(UpgradedGiftAttributeIdBackdrop value)? backdrop,
  TResult Function(UpgradedGiftAttributeIdModel value)? model,
  TResult Function(UpgradedGiftAttributeIdSymbol value)? symbol,
  required TResult Function() orElse,
}) {
  switch (getConstructor()) {
    case UpgradedGiftAttributeIdBackdrop.constructor:
      if (backdrop != null) {
        return backdrop.call(this as UpgradedGiftAttributeIdBackdrop);
      }
      break;
    case UpgradedGiftAttributeIdModel.constructor:
      if (model != null) {
        return model.call(this as UpgradedGiftAttributeIdModel);
      }
      break;
    case UpgradedGiftAttributeIdSymbol.constructor:
      if (symbol != null) {
        return symbol.call(this as UpgradedGiftAttributeIdSymbol);
      }
      break;
  }
  return orElse.call();
}