get method

  1. @override
Future<String?> get(
  1. String key
)
override

Gets the value of key.

Returns the string value if the key exists, or null if the key does not exist. Throws a ValkeyServerException if the key holds a non-string value.

Implementation

@override
Future<String?> get(String key) async {
  final response = await execute(['GET', key]);
  // The parser will return a String or null.
  return response as String?;
}