maybeMap<TResult extends Object?> method
TResult
maybeMap<TResult extends Object?>({
- TResult closed()?,
- TResult countryRestricted()?,
- TResult membershipRequired()?,
- TResult other()?,
- TResult scheduled()?,
- TResult yetUnsent()?,
- required TResult orElse(),
Implementation
TResult maybeMap<TResult extends Object?>({
TResult Function(PollVoteRestrictionReasonClosed value)? closed,
TResult Function(PollVoteRestrictionReasonCountryRestricted value)?
countryRestricted,
TResult Function(PollVoteRestrictionReasonMembershipRequired value)?
membershipRequired,
TResult Function(PollVoteRestrictionReasonOther value)? other,
TResult Function(PollVoteRestrictionReasonScheduled value)? scheduled,
TResult Function(PollVoteRestrictionReasonYetUnsent value)? yetUnsent,
required TResult Function() orElse,
}) {
switch (getConstructor()) {
case PollVoteRestrictionReasonClosed.constructor:
if (closed != null) {
return closed.call(this as PollVoteRestrictionReasonClosed);
}
break;
case PollVoteRestrictionReasonCountryRestricted.constructor:
if (countryRestricted != null) {
return countryRestricted.call(
this as PollVoteRestrictionReasonCountryRestricted,
);
}
break;
case PollVoteRestrictionReasonMembershipRequired.constructor:
if (membershipRequired != null) {
return membershipRequired.call(
this as PollVoteRestrictionReasonMembershipRequired,
);
}
break;
case PollVoteRestrictionReasonOther.constructor:
if (other != null) {
return other.call(this as PollVoteRestrictionReasonOther);
}
break;
case PollVoteRestrictionReasonScheduled.constructor:
if (scheduled != null) {
return scheduled.call(this as PollVoteRestrictionReasonScheduled);
}
break;
case PollVoteRestrictionReasonYetUnsent.constructor:
if (yetUnsent != null) {
return yetUnsent.call(this as PollVoteRestrictionReasonYetUnsent);
}
break;
}
return orElse.call();
}