maybeWhen<T> method

T maybeWhen<T>({
  1. T? guest()?,
  2. T? user()?,
  3. required T orElse(),
})

Implementation

T maybeWhen<T>({
  T? Function()? guest,
  T? Function()? user,
  required T Function() orElse,
}) =>
    {
      AccountKind.guest: guest,
      AccountKind.user: user,
    }[this]
        ?.call() ??
    orElse();