getValue<T> method
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;
}