diff --git a/lib/pages/video/commonVideo.dart b/lib/pages/video/commonVideo.dart index fd9016e..3a21e51 100644 --- a/lib/pages/video/commonVideo.dart +++ b/lib/pages/video/commonVideo.dart @@ -285,14 +285,17 @@ class _VideoDetailPageState extends State { ), context: context, builder: (context) { - return CommentBottomSheet( + return SafeArea( + child: CommentBottomSheet( videoId: videoId, onCommentCountChanged: (newCount) { // 更新视频的评论数量 setState(() { videoData['commentsCounts'] = newCount; }); - }); + }, + ), + ); }, ); } diff --git a/lib/pages/video/module/attention.dart b/lib/pages/video/module/attention.dart index f8b5631..acba145 100644 --- a/lib/pages/video/module/attention.dart +++ b/lib/pages/video/module/attention.dart @@ -771,7 +771,8 @@ class _AttentionModuleState extends State { ), context: context, builder: (context) { - return CommentBottomSheet( + return SafeArea( + child: CommentBottomSheet( videoId: videoId, onCommentCountChanged: (newCount) { // 更新对应视频的评论数量 @@ -780,7 +781,9 @@ class _AttentionModuleState extends State { videoList[index]['commentsCounts'] = newCount; } }); - }); + }, + ), + ); }, ); } @@ -1291,15 +1294,16 @@ class _AttentionModuleState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ if (videoModuleController.videoPlayIndex.value < videoList.length) - Text( - '@${videoList[videoModuleController.videoPlayIndex.value]['nickname'] ?? '未知'}', - style: const TextStyle(color: Colors.white, fontSize: 16.0), - ) else + Text( + '@${videoList[videoModuleController.videoPlayIndex.value]['nickname'] ?? '未知'}', + style: const TextStyle(color: Colors.white, fontSize: 16.0), + ) + else Text( '@未知', style: const TextStyle(color: Colors.white, fontSize: 16.0), ), - if (videoModuleController.videoPlayIndex.value < videoList.length) + if (videoModuleController.videoPlayIndex.value < videoList.length) LayoutBuilder( builder: (context, constraints) { final text = videoList[videoModuleController.videoPlayIndex.value]['title'] ?? '未知'; @@ -1350,8 +1354,9 @@ class _AttentionModuleState extends State { ], ); }, - )else - SizedBox() + ) + else + SizedBox() ], )), Positioned( diff --git a/lib/pages/video/module/friend.dart b/lib/pages/video/module/friend.dart index 76ba539..66889c4 100644 --- a/lib/pages/video/module/friend.dart +++ b/lib/pages/video/module/friend.dart @@ -772,7 +772,8 @@ class _FriendModuleState extends State { ), context: context, builder: (context) { - return CommentBottomSheet( + return SafeArea( + child: CommentBottomSheet( videoId: videoId, onCommentCountChanged: (newCount) { // 更新对应视频的评论数量 @@ -781,7 +782,9 @@ class _FriendModuleState extends State { videoList[index]['commentsCounts'] = newCount; } }); - }); + }, + ), + ); }, ); } @@ -1305,9 +1308,9 @@ class _FriendModuleState extends State { '@未知', style: const TextStyle(color: Colors.white, fontSize: 16.0), ), - // 对下面的 LayoutBuilder 也需要同样的检查 + // 对下面的 LayoutBuilder 也需要同样的检查 if (videoModuleController.videoPlayIndex.value < videoList.length) - LayoutBuilder( + LayoutBuilder( builder: (context, constraints) { final text = videoList[videoModuleController.videoPlayIndex.value]['title'] ?? '未知'; final span = TextSpan( @@ -1357,7 +1360,8 @@ class _FriendModuleState extends State { ], ); }, - )else + ) + else SizedBox() ], )),