when<T> method

T when<T>({
  1. required T ban(),
  2. required T invite(),
  3. required T join(),
  4. required T knock(),
  5. required T leave(),
})

Implementation

T when<T>({
  required T Function() ban,
  required T Function() invite,
  required T Function() join,
  required T Function() knock,
  required T Function() leave,
}) =>
    {
      Membership.ban: ban,
      Membership.invite: invite,
      Membership.join: join,
      Membership.knock: knock,
      Membership.leave: leave,
    }[this]!();