maybeWhen<T> method

T maybeWhen<T>({
  1. T? privateChat()?,
  2. T? publicChat()?,
  3. T? trustedPrivateChat()?,
  4. required T orElse(),
})

Implementation

T maybeWhen<T>({
  T? Function()? privateChat,
  T? Function()? publicChat,
  T? Function()? trustedPrivateChat,
  required T Function() orElse,
}) =>
    {
      CreateRoomPreset.privateChat: privateChat,
      CreateRoomPreset.publicChat: publicChat,
      CreateRoomPreset.trustedPrivateChat: trustedPrivateChat,
    }[this]
        ?.call() ??
    orElse();