get<T> static method
Retrieve data from the local cache 取出缓存
Implementation
static T? get<T>(String key) {
Object? value = _preferences.get(key);
if (value is String) {
try {
return json.decode(value);
} catch (_) {
return value as T?;
}
}
return value as T?;
}