mod: 评论过少无法刷新

This commit is contained in:
orz12
2024-02-27 22:19:42 +08:00
parent 2d2e1014e4
commit df56f0dfa5

View File

@@ -117,20 +117,18 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
return RefreshIndicator( return RefreshIndicator(
onRefresh: () async { onRefresh: () async {
_videoReplyController.currentPage = 0; await _videoReplyController.queryReplyList(type: 'init');
_videoReplyController.noMore.value = '';
await _videoReplyController.queryReplyList();
}, },
child: Stack( child: Stack(
children: [ children: [
CustomScrollView( CustomScrollView(
controller: scrollController, controller: scrollController,
physics: const AlwaysScrollableScrollPhysics(),
key: const PageStorageKey<String>('评论'), key: const PageStorageKey<String>('评论'),
slivers: <Widget>[ slivers: <Widget>[
SliverPersistentHeader( SliverPersistentHeader(
@@ -268,7 +266,10 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
(value) => { (value) => {
// 完成评论,数据添加 // 完成评论,数据添加
if (value != null && value['data'] != null) if (value != null && value['data'] != null)
{_videoReplyController.replyList.insert(0, value['data'])} {
_videoReplyController.replyList
.insert(0, value['data'])
}
}, },
); );
}, },