fix(player): 收藏与评论数实时刷新

This commit is contained in:
Zhou Weidong committed 2026-10-21 11:39:58 +08:00
1 parent 97bbced02c
commit 5e2b8d9e4d
11 files changed
+275 -29

No files matched your search

@@ -42,6 +42,8 @@ class FakeCommentRepository implements CommentRepository {
this.publishError,
this.deleteError,
this.pageError,
this.countResult = 0,
this.countError,
}) : pages = pages ?? const [];
final List<CommentPage> pages;
@@ -49,9 +51,12 @@ class FakeCommentRepository implements CommentRepository {
final Object? publishError;
final Object? deleteError;
final Object? pageError;
final int countResult;
final Object? countError;
final List<CommentPageCall> pageCalls = [];
final List<PublishCall> publishCalls = [];
final List<String> deleteCalls = [];
final List<String> countCalls = [];
int _pageIndex = 0;
@override
@@ -75,6 +80,14 @@ class FakeCommentRepository implements CommentRepository {
return pages[_pageIndex++];
}
@override
Future<int> count(String dramaId) async {
countCalls.add(dramaId);
final error = countError;
if (error != null) throw error;
return countResult;
}
@override
Future<DramaComment> publish({
required String dramaId,