get<T> method
获取缓存
Implementation
@override
Future<T?> get<T>(
String key,
T Function(Map<String, dynamic>) fromJson,
) async {
final item = _cache[key];
if (item == null) return null;
// 检查是否过期
if (item.isExpired) {
_cache.remove(key);
return null;
}
// 标记为已访问(LRU算法)
item.markAccess();
return item.data as T?;
}