fix(flutter): 首页 feed 静默刷新与进度条细节
This commit is contained in:
1 parent
a3126723d2
commit
82fe237c24
8 files changed
+190
-17
No files matched your search
@@ -44,6 +44,19 @@ class CatalogController extends ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
/// 静默刷新首页聚合:成功替换数据,失败返回 false。
|
||||
///
|
||||
/// 不触碰 [loading]/[error],因此页面不会切到全屏 loading 或清空旧数据。
|
||||
Future<bool> refresh() async {
|
||||
try {
|
||||
feed = await repository.fetchHomeFeed();
|
||||
notifyListeners();
|
||||
return true;
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// 需要完整剧集时补一次详情;已加载过则直接返回,避免重复请求。
|
||||
Future<Drama> requireDetail(Drama drama) async {
|
||||
if (drama.detailLoaded) return drama;
|
||||
|
||||
Reference in new issue
Block a user