maybeWhen<T> method
T
maybeWhen<T>({
- T? ban()?,
- T? invite()?,
- T? join()?,
- T? knock()?,
- T? leave()?,
- required T orElse(),
Implementation
T maybeWhen<T>({
T? Function()? ban,
T? Function()? invite,
T? Function()? join,
T? Function()? knock,
T? Function()? leave,
required T Function() orElse,
}) =>
{
Membership.ban: ban,
Membership.invite: invite,
Membership.join: join,
Membership.knock: knock,
Membership.leave: leave,
}[this]
?.call() ??
orElse();