when<T> method

T when<T>({
  1. required T privateChat(),
  2. required T publicChat(),
  3. required T trustedPrivateChat(),
})

Implementation

T when<T>({
  required T Function() privateChat,
  required T Function() publicChat,
  required T Function() trustedPrivateChat,
}) =>
    {
      CreateRoomPreset.privateChat: privateChat,
      CreateRoomPreset.publicChat: publicChat,
      CreateRoomPreset.trustedPrivateChat: trustedPrivateChat,
    }[this]!();