createRoom method

Future<Room> createRoom(
  1. String gameName
)

Function to create a room

Implementation

Future<Room> createRoom(String gameName) async {
  DatabaseReference ref = _roomsRef!.child(generateRandomRoomId());
  await ref.set(_gameMap[gameName]!.prefabData);
  return Room(ref.key!, this, lref: ref);
}