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.
  • Useful for fetching shared state when joining a meeting or reloading a view.
  • Throws an error if the key is missing/empty or if the request fails.

Parameters:

  • key - The key whose value you want to retrieve.

Returns:

  • Future<String?> - The stored value or null if there was a problem fetching the value.

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);