首页3个tab视频快速切换index边界问题修复

This commit is contained in:
Seven Tsui 2025-09-22 15:16:40 +08:00
parent 2ba610ca7f
commit 6291dbc55d
3 changed files with 173 additions and 150 deletions

View File

@ -1294,10 +1294,16 @@ class _AttentionModuleState extends State<AttentionModule> {
child: Column(
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(
'@未知',
style: const TextStyle(color: Colors.white, fontSize: 16.0),
),
if (videoModuleController.videoPlayIndex.value < videoList.length)
LayoutBuilder(
builder: (context, constraints) {
final text = videoList[videoModuleController.videoPlayIndex.value]['title'] ?? '未知';
@ -1348,7 +1354,8 @@ class _AttentionModuleState extends State<AttentionModule> {
],
);
},
),
)else
SizedBox()
],
)),
Positioned(

View File

@ -1299,10 +1299,18 @@ class _FriendModuleState extends State<FriendModule> {
child: Column(
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(
'@未知',
style: const TextStyle(color: Colors.white, fontSize: 16.0),
),
// LayoutBuilder
if (videoModuleController.videoPlayIndex.value < videoList.length)
LayoutBuilder(
builder: (context, constraints) {
final text = videoList[videoModuleController.videoPlayIndex.value]['title'] ?? '未知';
@ -1353,7 +1361,8 @@ class _FriendModuleState extends State<FriendModule> {
],
);
},
),
)else
SizedBox()
],
)),
Positioned(

View File

@ -1300,10 +1300,16 @@ class _RecommendModuleState extends State<RecommendModule> {
child: Column(
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(
'@未知',
style: const TextStyle(color: Colors.white, fontSize: 16.0),
),
if (videoModuleController.videoPlayIndex.value < videoList.length)
LayoutBuilder(
builder: (context, constraints) {
final text = videoList[videoModuleController.videoPlayIndex.value]['title'] ?? '未知';
@ -1353,7 +1359,8 @@ class _RecommendModuleState extends State<RecommendModule> {
],
);
},
),
)else
SizedBox()
],
)),
Positioned(