getValue<T> method

T? getValue<T>(
  1. String key
)

Implementation

T? getValue<T>(String key) {
  touch(); // Update access time on reads
  final value = values[key];
  if (value == null) {
    return null;
  }

  if (value is T) {
    return value;
  }

  // Handle common type conversions
  if (T == String && value != null) {
    return value.toString() as T;
  }

  // For other types, return null if type doesn't match
  return null;
}