diff --git a/lib/components/topic/reply_sheet.dart b/lib/components/topic/reply_sheet.dart index 574e409..cf7dcd0 100644 --- a/lib/components/topic/reply_sheet.dart +++ b/lib/components/topic/reply_sheet.dart @@ -115,22 +115,29 @@ class _ReplySheetState extends State with TickerProviderStateMixin { var i = widget.replyMemberList.indexOf(e); print('104: ${widget.resultList[i]}'); // return Text(e); - return ListView.builder( - physics: const ClampingScrollPhysics(), //重要 - itemCount: widget.resultList[i][e].length, - itemBuilder: (BuildContext context, int index) { - return Container( - padding: const EdgeInsets.symmetric(horizontal: 12), - child: ReplyListItem( - reply: widget.resultList[i][e][index], - topicId: widget.topicId, - totalPage: widget.totalPage, - source: 'sheet', - ), - ); - // return Text('123'); - }, - ); + return widget.resultList[i][e] != null + ? ListView.builder( + physics: const ClampingScrollPhysics(), //重要 + itemCount: widget.resultList[i][e]?.length, + itemBuilder: (BuildContext context, int index) { + return Container( + padding: + const EdgeInsets.symmetric(horizontal: 12), + child: ReplyListItem( + reply: widget.resultList[i][e][index], + topicId: widget.topicId, + totalPage: widget.totalPage, + source: 'sheet', + ), + ); + // return Text('123'); + }, + ) + : const SizedBox( + child: Center( + child: Text('无回复内容'), + ), + ); }).toList(), ), ),