getValue method

Future<String?> getValue(
  1. 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 null if the key is not set.
  • Useful for fetching shared state when joining a room or reloading a view.
  • Returns null only 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 key throws 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);