fix_视频评论安全区域

This commit is contained in:
abu 2025-10-11 18:22:44 +08:00
parent 0fd1ed8799
commit 9902980bf8
3 changed files with 28 additions and 16 deletions

View File

@ -285,14 +285,17 @@ class _VideoDetailPageState extends State<VideoDetailPage> {
), ),
context: context, context: context,
builder: (context) { builder: (context) {
return CommentBottomSheet( return SafeArea(
child: CommentBottomSheet(
videoId: videoId, videoId: videoId,
onCommentCountChanged: (newCount) { onCommentCountChanged: (newCount) {
// //
setState(() { setState(() {
videoData['commentsCounts'] = newCount; videoData['commentsCounts'] = newCount;
}); });
}); },
),
);
}, },
); );
} }

View File

@ -771,7 +771,8 @@ class _AttentionModuleState extends State<AttentionModule> {
), ),
context: context, context: context,
builder: (context) { builder: (context) {
return CommentBottomSheet( return SafeArea(
child: CommentBottomSheet(
videoId: videoId, videoId: videoId,
onCommentCountChanged: (newCount) { onCommentCountChanged: (newCount) {
// //
@ -780,7 +781,9 @@ class _AttentionModuleState extends State<AttentionModule> {
videoList[index]['commentsCounts'] = newCount; videoList[index]['commentsCounts'] = newCount;
} }
}); });
}); },
),
);
}, },
); );
} }
@ -1291,15 +1294,16 @@ class _AttentionModuleState extends State<AttentionModule> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (videoModuleController.videoPlayIndex.value < videoList.length) if (videoModuleController.videoPlayIndex.value < videoList.length)
Text( Text(
'@${videoList[videoModuleController.videoPlayIndex.value]['nickname'] ?? '未知'}', '@${videoList[videoModuleController.videoPlayIndex.value]['nickname'] ?? '未知'}',
style: const TextStyle(color: Colors.white, fontSize: 16.0), style: const TextStyle(color: Colors.white, fontSize: 16.0),
) else )
else
Text( Text(
'@未知', '@未知',
style: const TextStyle(color: Colors.white, fontSize: 16.0), style: const TextStyle(color: Colors.white, fontSize: 16.0),
), ),
if (videoModuleController.videoPlayIndex.value < videoList.length) if (videoModuleController.videoPlayIndex.value < videoList.length)
LayoutBuilder( LayoutBuilder(
builder: (context, constraints) { builder: (context, constraints) {
final text = videoList[videoModuleController.videoPlayIndex.value]['title'] ?? '未知'; final text = videoList[videoModuleController.videoPlayIndex.value]['title'] ?? '未知';
@ -1350,8 +1354,9 @@ class _AttentionModuleState extends State<AttentionModule> {
], ],
); );
}, },
)else )
SizedBox() else
SizedBox()
], ],
)), )),
Positioned( Positioned(

View File

@ -772,7 +772,8 @@ class _FriendModuleState extends State<FriendModule> {
), ),
context: context, context: context,
builder: (context) { builder: (context) {
return CommentBottomSheet( return SafeArea(
child: CommentBottomSheet(
videoId: videoId, videoId: videoId,
onCommentCountChanged: (newCount) { onCommentCountChanged: (newCount) {
// //
@ -781,7 +782,9 @@ class _FriendModuleState extends State<FriendModule> {
videoList[index]['commentsCounts'] = newCount; videoList[index]['commentsCounts'] = newCount;
} }
}); });
}); },
),
);
}, },
); );
} }
@ -1305,9 +1308,9 @@ class _FriendModuleState extends State<FriendModule> {
'@未知', '@未知',
style: const TextStyle(color: Colors.white, fontSize: 16.0), style: const TextStyle(color: Colors.white, fontSize: 16.0),
), ),
// LayoutBuilder // LayoutBuilder
if (videoModuleController.videoPlayIndex.value < videoList.length) if (videoModuleController.videoPlayIndex.value < videoList.length)
LayoutBuilder( LayoutBuilder(
builder: (context, constraints) { builder: (context, constraints) {
final text = videoList[videoModuleController.videoPlayIndex.value]['title'] ?? '未知'; final text = videoList[videoModuleController.videoPlayIndex.value]['title'] ?? '未知';
final span = TextSpan( final span = TextSpan(
@ -1357,7 +1360,8 @@ class _FriendModuleState extends State<FriendModule> {
], ],
); );
}, },
)else )
else
SizedBox() SizedBox()
], ],
)), )),