Room class
A class to represent a room
Constructors
- Room(String _id, GameManager gameManager, {DatabaseReference? lref})
Properties
- adminId → String
-
The admin of the room
no setter
- amAdmin → bool
-
Whether the current user is the admin
no setter
-
data
↔ Map<
String, dynamic> -
getter/setter pair
- gameManager → GameManager
-
final
- gameName → String
-
The name of the current game
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
The id of the room
no setter
- inLobby → bool
-
Whether the room is in the lobby
no setter
-
listeners
↔ List<
void Function(Map< String, dynamic> data)?> -
getter/setter pair
- myDataRef ↔ DatabaseReference
-
getter/setter pair
- myId → String
-
The id of the current user
no setter
-
players
→ List<
String> -
A list of players in the room
no setter
- ref ↔ DatabaseReference?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addDataListener(
void onValue(Map< String, dynamic> data)?) → void - Function to add a listener to the room
-
addToList(
String key, dynamic value) → Future< bool> - Function to add a value to a list in the room
-
dbListen(
) → void -
disconnect(
) → Future< void> - Function to leave a room
-
get<
T> (String key) → T? - Function to get a value from the room
-
getBool(
String key) → bool? - Function to get a bool from the room
-
getDouble(
String key) → double? - Function to get a double from the room
-
getGameView(
) → Widget - returns the view of the game
-
getInt(
String key) → int? - Function to get an int from the room
-
getKey(
String key) → dynamic - Function to get a value from the room
-
getList<
T> (String key) → List - Function to get a list from the room
-
getMap<
T> (String key) → Map< String, T> - Function to get a map from the room
-
getPlayers(
) → List< String> -
getString(
String key) → String? - Function to get a string from the room
-
goBackToLobby(
) → Future< bool> - Function to go back to the lobby
-
isAdmin(
String uid) → bool - Whether the sone user is the admin
-
join(
String myName) → Future - Function to join the room
-
joined(
String uid) → bool - Function to check if a user has joined the room
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeFromList<
T> (String key, T value) → void - Function to remove a value from a list in the room
-
set(
String key, dynamic value) → Future< bool> - Function to set a value of a key in the room
-
startGame(
) → Future< bool> - Function to start the game
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited