maybeMap<TResult extends Object?> method
TResult
maybeMap<TResult extends Object?>({
- TResult epic()?,
- TResult legendary()?,
- TResult perMille()?,
- TResult rare()?,
- TResult uncommon()?,
- required TResult orElse(),
Implementation
TResult maybeMap<TResult extends Object?>({
TResult Function(UpgradedGiftAttributeRarityEpic value)? epic,
TResult Function(UpgradedGiftAttributeRarityLegendary value)? legendary,
TResult Function(UpgradedGiftAttributeRarityPerMille value)? perMille,
TResult Function(UpgradedGiftAttributeRarityRare value)? rare,
TResult Function(UpgradedGiftAttributeRarityUncommon value)? uncommon,
required TResult Function() orElse,
}) {
switch (getConstructor()) {
case UpgradedGiftAttributeRarityEpic.constructor:
if (epic != null) {
return epic.call(this as UpgradedGiftAttributeRarityEpic);
}
break;
case UpgradedGiftAttributeRarityLegendary.constructor:
if (legendary != null) {
return legendary.call(this as UpgradedGiftAttributeRarityLegendary);
}
break;
case UpgradedGiftAttributeRarityPerMille.constructor:
if (perMille != null) {
return perMille.call(this as UpgradedGiftAttributeRarityPerMille);
}
break;
case UpgradedGiftAttributeRarityRare.constructor:
if (rare != null) {
return rare.call(this as UpgradedGiftAttributeRarityRare);
}
break;
case UpgradedGiftAttributeRarityUncommon.constructor:
if (uncommon != null) {
return uncommon.call(this as UpgradedGiftAttributeRarityUncommon);
}
break;
}
return orElse.call();
}