get<T> static method
value只支持int、double、bool、String基础数据 自定义对象数据请使用putWithJson
Implementation
static Future<T?> get<T>(String key, {T? defaultValue}) async {
if (_storage != null) {
try {
return (await _storage!.get<T>(key)) ?? defaultValue;
} catch (e) {
Log.w(e.toString());
}
}
return defaultValue;
}