refa: query data (#659)

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
dom
2025-04-10 21:43:01 +08:00
committed by GitHub
parent 99b19e7b03
commit e1b73f4766
128 changed files with 1493 additions and 1987 deletions

View File

@@ -45,7 +45,7 @@ class VideoReplyPanel extends StatefulWidget {
}
class _VideoReplyPanelState extends State<VideoReplyPanel>
with AutomaticKeepAliveClientMixin, TickerProviderStateMixin {
with AutomaticKeepAliveClientMixin {
late VideoReplyController _videoReplyController;
String get heroTag => widget.heroTag;
@@ -202,12 +202,12 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
childCount: 5,
),
),
Success() => (loadingState.response.replies as List?)?.isNotEmpty == true
Success() => loadingState.response?.isNotEmpty == true
? SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, index) {
double bottom = MediaQuery.of(context).padding.bottom;
if (index == loadingState.response.replies.length) {
if (index == loadingState.response.length) {
_videoReplyController.onLoadMore();
return Container(
alignment: Alignment.center,
@@ -216,7 +216,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
child: Text(
_videoReplyController.isEnd.not
? '加载中...'
: loadingState.response.replies.isEmpty
: loadingState.response.isEmpty
? '还没有评论'
: '没有更多了',
style: TextStyle(
@@ -227,18 +227,19 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
);
} else {
return ReplyItemGrpc(
replyItem: loadingState.response.replies[index],
replyItem: loadingState.response[index],
replyLevel: widget.replyLevel,
replyReply: widget.replyReply,
onReply: () {
_videoReplyController.onReply(
context,
replyItem: loadingState.response.replies[index],
replyItem: loadingState.response[index],
index: index,
);
},
onDelete: _videoReplyController.onMDelete,
upMid: loadingState.response.subjectControl.upMid,
onDelete: (subIndex) =>
_videoReplyController.onRemove(index, subIndex),
upMid: _videoReplyController.upMid,
getTag: () => heroTag,
onViewImage: widget.onViewImage,
onDismissed: widget.onDismissed,
@@ -256,7 +257,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
);
}
},
childCount: loadingState.response.replies.length + 1,
childCount: loadingState.response.length + 1,
),
)
: HttpError(