getValue method
- String key
The getValue() method retrieves the current value associated with a given key.
Key Notes:
- Returns the current string value for the given key, or
nullif the key is not set. - Useful for fetching shared state when joining a room or reloading a view.
- Returns
nullonly when the server answers with no value. - Throws if the room has not been joined yet or the request fails, including
a key that was never set or was cleared (VideoSDKError
4046). - An empty
keythrows a VideoSDKError (3073).
Parameters
key- The key whose value you want to retrieve.
Example
String key = "BLOCK_CHAT";
try {
String? response = await room.realtimeStore.getValue(key);
print("Realtime Store Get Value: $response");
} catch(e) {
print("Error:$e");
}
Implementation
Future<String?> getValue(String key) => _getValue(key);