feat(缓存): 添加本地缓存功能并优化网络状态提示
实现本地缓存管理器,支持预加载开关和排行榜数据缓存 优化网络状态提示文案和错误处理 移除调试日志打印,改进用户体验
This commit is contained in:
@@ -191,7 +191,6 @@ class _HomePageState extends State<HomePage>
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
debugPrint('加载诗词失败: $e');
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_loading = false;
|
||||
@@ -269,7 +268,6 @@ class _HomePageState extends State<HomePage>
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
debugPrint('加载指定诗词失败: $e');
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_poetryData = _createDefaultPoetryData();
|
||||
@@ -500,7 +498,7 @@ class _HomePageState extends State<HomePage>
|
||||
if (mounted) {
|
||||
PoetryStateManager.showSnackBar(
|
||||
context,
|
||||
'加载下一条失败',
|
||||
'加载下一条失败,建议开启离线模式',
|
||||
backgroundColor: AppConstants.errorColor,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user