fix_朋友&关注

This commit is contained in:
abu 2025-10-13 13:17:36 +08:00
parent 9902980bf8
commit 314aeddf23
7 changed files with 178 additions and 103 deletions

View File

@ -75,10 +75,9 @@ class PushService {
if (Platform.isAndroid) {
await TencentImSDKPlugin.v2TIMManager.login(userID: Storage.read('userId'), userSig: Storage.read('userSig'));
}
final token = await TencentCloudChatPush().getAndroidPushToken();
// final token = await TencentCloudChatPush().getAndroidPushToken();
logger.i(
'推送服务已注册,手机:$devices,证书ID:$apnsCertificateID,token=${token.code},tk=${token.data}',
'推送服务已注册,手机:$devices,证书ID:$apnsCertificateID',
);
// 线

View File

@ -5,6 +5,8 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:loopin/IM/controller/tab_bar_controller.dart';
import 'package:loopin/models/tab_type.dart';
import 'package:loopin/pages/video/module/attention.dart';
import 'package:loopin/pages/video/module/friend.dart';
import 'package:loopin/pages/video/module/recommend.dart';
import 'package:loopin/update/upgrade_service.dart';
import 'package:loopin/utils/common.dart';
@ -250,8 +252,16 @@ class _LayoutState extends State<Layout> {
if (videoModuleController.videoTabIndex.value == 2) {
RecommendModule.playVideo();
}
if (videoModuleController.videoTabIndex.value == 1) {
FriendModule.playVideo();
}
if (videoModuleController.videoTabIndex.value == 0) {
AttentionModule.playVideo();
}
} else {
RecommendModule.pauseVideo();
FriendModule.pauseVideo();
AttentionModule.pauseVideo();
}
if ([2, 3, 4].contains(index) && !Common.isLogin()) {
Get.toNamed('/login');

View File

@ -7,7 +7,7 @@ extension ShareTypeExtension on ShareType {
case ShareType.video:
return 'https://wuzhongjie.com.cn/spa/video-detail';
case ShareType.shop:
return 'https://wuzhongjie.com.cn/spa/goods-derail';
return 'https://wuzhongjie.com.cn/spa/goods-detail';
}
}
}

View File

@ -32,6 +32,7 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:shirne_dialog/shirne_dialog.dart';
import 'package:tencent_cloud_chat_sdk/enum/message_status.dart';
import 'package:tencent_cloud_chat_sdk/models/v2_tim_conversation.dart';
import 'package:tencent_cloud_chat_sdk/models/v2_tim_friend_info.dart';
import 'package:tencent_cloud_chat_sdk/models/v2_tim_message.dart';
import 'package:video_player/video_player.dart';
import 'package:wechat_assets_picker/wechat_assets_picker.dart';
@ -58,6 +59,8 @@ class _ChatState extends State<Chat> with SingleTickerProviderStateMixin {
//
late final Rx<V2TimConversation> arguments;
String blackTxt = '拉黑';
late String selfUserId;
//
@ -167,6 +170,65 @@ class _ChatState extends State<Chat> with SingleTickerProviderStateMixin {
super.dispose();
}
//
Future<void> getBlackList() async {
final res = await ImService.instance.blackList();
if (res.success && res.data != null) {
//
final data = res.data;
for (V2TimFriendInfo element in data ?? []) {
logger.w(element.toJson());
if (element.userID == arguments.value.userID) {
//
logger.e('匹配');
blackTxt = '取消拉黑';
}
}
}
}
//
void _cancelBlack() async {
logger.w('开始执行取消拉黑${arguments.value.userID}');
final res = await ImService.instance.deleteFromBlackList(userIDList: [arguments.value.userID ?? '']);
logger.w(res.success);
//
if (res.success) {
blackTxt = '拉黑';
Get.back();
}
}
//
void _addBlack() async {
logger.w('开始执行拉黑${arguments.value.userID}');
final res = await ImService.instance.addToBlackList(userIDList: [arguments.value.userID ?? '']);
logger.w(res.success);
//
if (res.success) {
blackTxt = '取消拉黑';
//退
await ImService.instance.deleteConversation(conversationID: 'c2c_${arguments.value.userID}');
final ctl = Get.find<ChatController>();
ctl.chatList.removeWhere(
(conv) => conv.conversation.conversationID == 'c2c_${arguments.value.userID}',
);
ctl.chatList.refresh();
Get.back();
Get.back();
}
}
///
void _handleBlack() {
if (blackTxt == '拉黑') {
//_addBlack
_addBlack();
} else {
_cancelBlack();
}
}
//
void setRemark() async {
String remark = '';
@ -344,24 +406,26 @@ class _ChatState extends State<Chat> with SingleTickerProviderStateMixin {
),
SizedBox(width: 4),
],
Ink(
decoration: BoxDecoration(
color: !(item.isSelf ?? false) ? Color(0xFFFFFFFF) : Color(0xFF89E45B),
borderRadius: BorderRadius.circular(10.0),
),
child: InkWell(
overlayColor: WidgetStateProperty.all(Colors.transparent),
borderRadius: BorderRadius.circular(10.0),
child: Container(
padding: const EdgeInsets.all(10.0),
child: RichTextUtil.getRichText(
item.textElem?.text ?? '',
color: !(item.isSelf ?? false) ? Colors.black : Colors.white,
), // emoj//
Flexible(
child: Ink(
decoration: BoxDecoration(
color: !(item.isSelf ?? false) ? Color(0xFFFFFFFF) : Color(0xFF89E45B),
borderRadius: BorderRadius.circular(10.0),
),
child: InkWell(
overlayColor: WidgetStateProperty.all(Colors.transparent),
borderRadius: BorderRadius.circular(10.0),
child: Container(
padding: const EdgeInsets.all(10.0),
child: RichTextUtil.getRichText(
item.textElem?.text ?? '',
color: !(item.isSelf ?? false) ? Colors.black : Colors.white,
), // emoj//
),
onLongPress: () {
contextMenuDialog();
},
),
onLongPress: () {
contextMenuDialog();
},
),
),
],
@ -1820,23 +1884,23 @@ class _ChatState extends State<Chat> with SingleTickerProviderStateMixin {
}
//
void _handleBlack() async {
logger.w('开始执行拉黑${arguments.value.userID}');
final res = await ImService.instance.addToBlackList(userIDList: [arguments.value.userID ?? '']);
logger.w(res.success);
//
if (res.success) {
//退
await ImService.instance.deleteConversation(conversationID: arguments.value.conversationID);
final ctl = Get.find<ChatController>();
ctl.chatList.removeWhere(
(conv) => conv.conversation.conversationID == arguments.value.conversationID,
);
ctl.chatList.refresh();
Get.back();
Get.back();
}
}
// void _handleBlack() async {
// logger.w('开始执行拉黑${arguments.value.userID}');
// final res = await ImService.instance.addToBlackList(userIDList: [arguments.value.userID ?? '']);
// logger.w(res.success);
// //
// if (res.success) {
// //退
// await ImService.instance.deleteConversation(conversationID: arguments.value.conversationID);
// final ctl = Get.find<ChatController>();
// ctl.chatList.removeWhere(
// (conv) => conv.conversation.conversationID == arguments.value.conversationID,
// );
// ctl.chatList.refresh();
// Get.back();
// Get.back();
// }
// }
//
void sendRedPacketDialog() {
@ -1915,6 +1979,7 @@ class _ChatState extends State<Chat> with SingleTickerProviderStateMixin {
color: Colors.white,
),
onPressed: () async {
await getBlackList();
final paddingTop = MediaQuery.of(Get.context!).padding.top;
final selected = await showMenu(
@ -1976,7 +2041,7 @@ class _ChatState extends State<Chat> with SingleTickerProviderStateMixin {
Icon(Icons.block, color: Colors.white, size: 18),
SizedBox(width: 8),
Text(
'拉黑',
blackTxt,
style: TextStyle(color: Colors.white),
),
],
@ -2015,11 +2080,12 @@ class _ChatState extends State<Chat> with SingleTickerProviderStateMixin {
break;
case 'block':
// print('点击了拉黑');
String showTxt = blackTxt == '拉黑' ? '拉黑后将不保留任何聊天记录' : '';
showDialog(
context: context,
builder: (context) {
return AlertDialog(
content: const Text('确认要拉黑对方吗?拉黑后将不保留任何聊天记录', style: TextStyle(fontSize: 16.0)),
content: Text('确认要$blackTxt对方吗$showTxt', style: TextStyle(fontSize: 16.0)),
backgroundColor: Colors.white,
surfaceTintColor: Colors.white,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15.0)),
@ -2032,7 +2098,7 @@ class _ChatState extends State<Chat> with SingleTickerProviderStateMixin {
},
child: const Text('取消', style: TextStyle(color: Colors.black54)),
),
TextButton(onPressed: _handleBlack, child: const Text('确认拉黑', style: TextStyle(color: Colors.red))),
TextButton(onPressed: _handleBlack, child: const Text('确认', style: TextStyle(color: Colors.red))),
],
);
},

View File

@ -9,16 +9,10 @@ import '../../IM/im_core.dart';
import '../../behavior/custom_scroll_behavior.dart';
import '../../components/keepalive_wrapper.dart';
import '../../controller/video_module_controller.dart';
import './module/attention.dart';
// import './module/browse.dart';
// import './module/buying.dart';
// import './module/drama.dart';
// import './module/live.dart';
import './module/friend.dart';
import './module/recommend.dart';
// tab内容模块
// import './module/subscribe.dart';
class VideoPage extends StatefulWidget {
const VideoPage({super.key});
@ -118,8 +112,8 @@ class _VideoPageState extends State<VideoPage> with SingleTickerProviderStateMix
onTap: (index) {
// tabtab都校验登录状态
if (!Common.isLogin() && index != 2) {
Get.toNamed('/login');
return;
Get.toNamed('/login');
return;
}
//
videoModuleController.updateVideoTabIndex(index);
@ -137,12 +131,18 @@ class _VideoPageState extends State<VideoPage> with SingleTickerProviderStateMix
),
onPressed: () {
print('当前tab索引:${videoModuleController.videoTabIndex.value}');
if(videoModuleController.videoTabIndex.value == 0){
AttentionModule.pauseVideo();
}else if(videoModuleController.videoTabIndex.value ==1){
if (videoModuleController.videoTabIndex.value == 0) {
AttentionModule.playVideo();
FriendModule.pauseVideo();
}else if(videoModuleController.videoTabIndex.value ==2){
RecommendModule.pauseVideo();
} else if (videoModuleController.videoTabIndex.value == 1) {
AttentionModule.pauseVideo();
FriendModule.playVideo();
RecommendModule.pauseVideo();
} else if (videoModuleController.videoTabIndex.value == 2) {
AttentionModule.pauseVideo();
FriendModule.pauseVideo();
RecommendModule.playVideo();
}
Get.toNamed('/search');
},
@ -159,15 +159,15 @@ class _VideoPageState extends State<VideoPage> with SingleTickerProviderStateMix
// tab
if (index == 0) {
AttentionModule.playVideo();
// FriendModule.pauseVideo();
FriendModule.pauseVideo();
RecommendModule.pauseVideo();
} else if (index == 1) {
AttentionModule.pauseVideo();
// FriendModule.playVideo();
FriendModule.playVideo();
RecommendModule.pauseVideo();
} else if (index == 2) {
AttentionModule.pauseVideo();
// FriendModule.pauseVideo();
FriendModule.pauseVideo();
RecommendModule.playVideo();
}
videoModuleController.updateVideoTabIndex(index);

View File

@ -557,7 +557,7 @@ class _AttentionModuleState extends State<AttentionModule> {
// controller
late PageController pageController = PageController(
initialPage: videoModuleController.videoPlayIndex.value,
initialPage: videoModuleController.videoPlayIndexFoucs.value,
viewportFraction: 1.0,
);
@ -656,7 +656,7 @@ class _AttentionModuleState extends State<AttentionModule> {
page = 1;
isLoadingMore = false;
videoList.clear();
videoModuleController.updateVideoPlayIndex(0);
videoModuleController.updateVideoPlayIndex2(0);
sliderValue = 0.0;
sliderDraging = false;
position = Duration.zero;
@ -708,7 +708,7 @@ class _AttentionModuleState extends State<AttentionModule> {
//
player.open(
Media(
videoList[videoModuleController.videoPlayIndex.value]['url'],
videoList[videoModuleController.videoPlayIndexFoucs.value]['url'],
),
play: false);
player.setPlaylistMode(PlaylistMode.loop); // ;
@ -905,9 +905,9 @@ class _AttentionModuleState extends State<AttentionModule> {
void handleShareClick(int index) {
print("分享项 $index 被点击");
final videoId = videoList[videoModuleController.videoPlayIndex.value]['id'];
final videoUrl = videoList[videoModuleController.videoPlayIndex.value]['url'];
final description = videoList[videoModuleController.videoPlayIndex.value]['title'] ?? '快来看看这个视频';
final videoId = videoList[videoModuleController.videoPlayIndexFoucs.value]['id'];
final videoUrl = videoList[videoModuleController.videoPlayIndexFoucs.value]['url'];
final description = videoList[videoModuleController.videoPlayIndexFoucs.value]['title'] ?? '快来看看这个视频';
logger.i('分享链接地址----------------: ${ShareType.video.name}?id=$videoId');
if (index == 0) {
//
@ -982,10 +982,10 @@ class _AttentionModuleState extends State<AttentionModule> {
void handlCoverClick(V2TimConversation conv) async {
// VideoMsg,
final userId = conv.userID;
final String url = videoList[videoModuleController.videoPlayIndex.value]['url'];
final img = videoList[videoModuleController.videoPlayIndex.value]['firstFrameImg'];
final width = videoList[videoModuleController.videoPlayIndex.value]['width'];
final height = videoList[videoModuleController.videoPlayIndex.value]['height'];
final String url = videoList[videoModuleController.videoPlayIndexFoucs.value]['url'];
final img = videoList[videoModuleController.videoPlayIndexFoucs.value]['firstFrameImg'];
final width = videoList[videoModuleController.videoPlayIndexFoucs.value]['width'];
final height = videoList[videoModuleController.videoPlayIndexFoucs.value]['height'];
final makeJson = jsonEncode({
"width": width,
"height": height,
@ -1049,7 +1049,7 @@ class _AttentionModuleState extends State<AttentionModule> {
scrollDirection: Axis.vertical,
controller: pageController,
onPageChanged: (index) async {
videoModuleController.updateVideoPlayIndex(index);
videoModuleController.updateVideoPlayIndex2(index);
setState(() {
sliderValue = 0.0;
sliderDraging = false;
@ -1081,7 +1081,7 @@ class _AttentionModuleState extends State<AttentionModule> {
child: Stack(
children: [
Visibility(
visible: videoModuleController.videoPlayIndex.value == index && position > Duration.zero,
visible: videoModuleController.videoPlayIndexFoucs.value == index && position > Duration.zero,
child: Video(
controller: videoController,
fit: isHorizontal ? BoxFit.contain : BoxFit.cover,
@ -1089,7 +1089,7 @@ class _AttentionModuleState extends State<AttentionModule> {
),
),
AnimatedOpacity(
opacity: videoModuleController.videoPlayIndex.value == index && position > Duration(milliseconds: 100) ? 0.0 : 1.0,
opacity: videoModuleController.videoPlayIndexFoucs.value == index && position > Duration(milliseconds: 100) ? 0.0 : 1.0,
duration: Duration(milliseconds: 50),
child: Image.network(
videoList[index]['firstFrameImg'] ?? 'https://wuzhongjie.com.cn/download/logo.png',
@ -1143,7 +1143,7 @@ class _AttentionModuleState extends State<AttentionModule> {
onTap: () async {
player.pause();
// Vloger
final vloggerId = videoList[videoModuleController.videoPlayIndex.value]['memberId'];
final vloggerId = videoList[videoModuleController.videoPlayIndexFoucs.value]['memberId'];
final result = await Get.toNamed('/vloger', arguments: {'memberId': vloggerId});
if (result != null) {
//
@ -1277,7 +1277,7 @@ class _AttentionModuleState extends State<AttentionModule> {
onTap: () async {
player.pause();
//
final result = await Get.toNamed('/report', arguments: videoList[videoModuleController.videoPlayIndex.value]);
final result = await Get.toNamed('/report', arguments: videoList[videoModuleController.videoPlayIndexFoucs.value]);
if (result != null) {
player.play();
}
@ -1293,9 +1293,9 @@ class _AttentionModuleState extends State<AttentionModule> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (videoModuleController.videoPlayIndex.value < videoList.length)
if (videoModuleController.videoPlayIndexFoucs.value < videoList.length)
Text(
'@${videoList[videoModuleController.videoPlayIndex.value]['nickname'] ?? '未知'}',
'@${videoList[videoModuleController.videoPlayIndexFoucs.value]['nickname'] ?? '未知'}',
style: const TextStyle(color: Colors.white, fontSize: 16.0),
)
else
@ -1303,10 +1303,10 @@ class _AttentionModuleState extends State<AttentionModule> {
'@未知',
style: const TextStyle(color: Colors.white, fontSize: 16.0),
),
if (videoModuleController.videoPlayIndex.value < videoList.length)
if (videoModuleController.videoPlayIndexFoucs.value < videoList.length)
LayoutBuilder(
builder: (context, constraints) {
final text = videoList[videoModuleController.videoPlayIndex.value]['title'] ?? '未知';
final text = videoList[videoModuleController.videoPlayIndexFoucs.value]['title'] ?? '未知';
final span = TextSpan(
text: text,
style: const TextStyle(color: Colors.white, fontSize: 14.0),
@ -1324,8 +1324,8 @@ class _AttentionModuleState extends State<AttentionModule> {
children: [
Text(
text,
maxLines: videoList[videoModuleController.videoPlayIndex.value]['expanded'] ? null : 3,
overflow: videoList[videoModuleController.videoPlayIndex.value]['expanded']
maxLines: videoList[videoModuleController.videoPlayIndexFoucs.value]['expanded'] ? null : 3,
overflow: videoList[videoModuleController.videoPlayIndexFoucs.value]['expanded']
? TextOverflow.visible
: TextOverflow.ellipsis,
style: const TextStyle(color: Colors.white, fontSize: 14.0),
@ -1336,12 +1336,12 @@ class _AttentionModuleState extends State<AttentionModule> {
child: GestureDetector(
onTap: () {
setState(() {
videoList[videoModuleController.videoPlayIndex.value]['expanded'] =
!videoList[videoModuleController.videoPlayIndex.value]['expanded'];
videoList[videoModuleController.videoPlayIndexFoucs.value]['expanded'] =
!videoList[videoModuleController.videoPlayIndexFoucs.value]['expanded'];
});
},
child: Text(
videoList[videoModuleController.videoPlayIndex.value]['expanded'] ? '收起' : '展开更多',
videoList[videoModuleController.videoPlayIndexFoucs.value]['expanded'] ? '收起' : '展开更多',
textAlign: TextAlign.right,
style: const TextStyle(
color: Colors.white,
@ -1364,7 +1364,7 @@ class _AttentionModuleState extends State<AttentionModule> {
left: 6.0,
right: 6.0,
child: Visibility(
visible: videoModuleController.videoPlayIndex.value == index && position > Duration.zero,
visible: videoModuleController.videoPlayIndexFoucs.value == index && position > Duration.zero,
child: Listener(
child: SliderTheme(
data: SliderThemeData(

View File

@ -558,7 +558,7 @@ class _FriendModuleState extends State<FriendModule> {
// controller
late PageController pageController = PageController(
initialPage: videoModuleController.videoPlayIndex.value,
initialPage: videoModuleController.videoPlayFriend.value,
viewportFraction: 1.0,
);
@ -657,7 +657,7 @@ class _FriendModuleState extends State<FriendModule> {
page = 1;
isLoadingMore = false;
videoList.clear();
videoModuleController.updateVideoPlayIndex(0);
videoModuleController.updateVideoPlayIndex1(0);
sliderValue = 0.0;
sliderDraging = false;
position = Duration.zero;
@ -709,7 +709,7 @@ class _FriendModuleState extends State<FriendModule> {
//
player.open(
Media(
videoList[videoModuleController.videoPlayIndex.value]['url'],
videoList[videoModuleController.videoPlayFriend.value]['url'],
),
play: false);
player.setPlaylistMode(PlaylistMode.loop); // ;
@ -905,9 +905,9 @@ class _FriendModuleState extends State<FriendModule> {
void handleShareClick(int index) {
print("分享项 $index 被点击");
final videoId = videoList[videoModuleController.videoPlayIndex.value]['id'];
final videoUrl = videoList[videoModuleController.videoPlayIndex.value]['url'];
final description = videoList[videoModuleController.videoPlayIndex.value]['title'] ?? '快来看看这个视频';
final videoId = videoList[videoModuleController.videoPlayFriend.value]['id'];
final videoUrl = videoList[videoModuleController.videoPlayFriend.value]['url'];
final description = videoList[videoModuleController.videoPlayFriend.value]['title'] ?? '快来看看这个视频';
logger.i('分享链接地址----------------: ${ShareType.video.name}?id=$videoId');
if (index == 0) {
//
@ -982,7 +982,7 @@ class _FriendModuleState extends State<FriendModule> {
void handlCoverClick(V2TimConversation conv) async {
// VideoMsg,
final userId = conv.userID;
final currentVideo = videoList[videoModuleController.videoPlayIndex.value];
final currentVideo = videoList[videoModuleController.videoPlayFriend.value];
logger.w(currentVideo);
final img = (currentVideo['cover'] != null && currentVideo['cover'].toString().isNotEmpty) ? currentVideo['cover'] : currentVideo['firstFrameImg'];
final url = currentVideo['url'];
@ -1054,7 +1054,7 @@ class _FriendModuleState extends State<FriendModule> {
scrollDirection: Axis.vertical,
controller: pageController,
onPageChanged: (index) async {
videoModuleController.updateVideoPlayIndex(index);
videoModuleController.updateVideoPlayIndex1(index);
setState(() {
sliderValue = 0.0;
sliderDraging = false;
@ -1086,7 +1086,7 @@ class _FriendModuleState extends State<FriendModule> {
child: Stack(
children: [
Visibility(
visible: videoModuleController.videoPlayIndex.value == index && position > Duration.zero,
visible: videoModuleController.videoPlayFriend.value == index && position > Duration.zero,
child: Video(
controller: videoController,
fit: isHorizontal ? BoxFit.contain : BoxFit.cover,
@ -1094,7 +1094,7 @@ class _FriendModuleState extends State<FriendModule> {
),
),
AnimatedOpacity(
opacity: videoModuleController.videoPlayIndex.value == index && position > Duration(milliseconds: 100) ? 0.0 : 1.0,
opacity: videoModuleController.videoPlayFriend.value == index && position > Duration(milliseconds: 100) ? 0.0 : 1.0,
duration: Duration(milliseconds: 50),
child: Image.network(
videoList[index]['firstFrameImg'] ?? 'https://wuzhongjie.com.cn/download/logo.png',
@ -1148,7 +1148,7 @@ class _FriendModuleState extends State<FriendModule> {
onTap: () async {
player.pause();
// Vloger
final vloggerId = videoList[videoModuleController.videoPlayIndex.value]['memberId'];
final vloggerId = videoList[videoModuleController.videoPlayFriend.value]['memberId'];
final result = await Get.toNamed('/vloger', arguments: {'memberId': vloggerId});
if (result != null) {
//
@ -1282,7 +1282,7 @@ class _FriendModuleState extends State<FriendModule> {
onTap: () async {
player.pause();
//
final result = await Get.toNamed('/report', arguments: videoList[videoModuleController.videoPlayIndex.value]);
final result = await Get.toNamed('/report', arguments: videoList[videoModuleController.videoPlayFriend.value]);
if (result != null) {
player.play();
}
@ -1298,9 +1298,9 @@ class _FriendModuleState extends State<FriendModule> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (videoModuleController.videoPlayIndex.value < videoList.length)
if (videoModuleController.videoPlayFriend.value < videoList.length)
Text(
'@${videoList[videoModuleController.videoPlayIndex.value]['nickname'] ?? '未知'}',
'@${videoList[videoModuleController.videoPlayFriend.value]['nickname'] ?? '未知'}',
style: const TextStyle(color: Colors.white, fontSize: 16.0),
)
else
@ -1309,10 +1309,10 @@ class _FriendModuleState extends State<FriendModule> {
style: const TextStyle(color: Colors.white, fontSize: 16.0),
),
// LayoutBuilder
if (videoModuleController.videoPlayIndex.value < videoList.length)
if (videoModuleController.videoPlayFriend.value < videoList.length)
LayoutBuilder(
builder: (context, constraints) {
final text = videoList[videoModuleController.videoPlayIndex.value]['title'] ?? '未知';
final text = videoList[videoModuleController.videoPlayFriend.value]['title'] ?? '未知';
final span = TextSpan(
text: text,
style: const TextStyle(color: Colors.white, fontSize: 14.0),
@ -1330,8 +1330,8 @@ class _FriendModuleState extends State<FriendModule> {
children: [
Text(
text,
maxLines: videoList[videoModuleController.videoPlayIndex.value]['expanded'] ? null : 3,
overflow: videoList[videoModuleController.videoPlayIndex.value]['expanded']
maxLines: videoList[videoModuleController.videoPlayFriend.value]['expanded'] ? null : 3,
overflow: videoList[videoModuleController.videoPlayFriend.value]['expanded']
? TextOverflow.visible
: TextOverflow.ellipsis,
style: const TextStyle(color: Colors.white, fontSize: 14.0),
@ -1342,12 +1342,12 @@ class _FriendModuleState extends State<FriendModule> {
child: GestureDetector(
onTap: () {
setState(() {
videoList[videoModuleController.videoPlayIndex.value]['expanded'] =
!videoList[videoModuleController.videoPlayIndex.value]['expanded'];
videoList[videoModuleController.videoPlayFriend.value]['expanded'] =
!videoList[videoModuleController.videoPlayFriend.value]['expanded'];
});
},
child: Text(
videoList[videoModuleController.videoPlayIndex.value]['expanded'] ? '收起' : '展开更多',
videoList[videoModuleController.videoPlayFriend.value]['expanded'] ? '收起' : '展开更多',
textAlign: TextAlign.right,
style: const TextStyle(
color: Colors.white,
@ -1370,7 +1370,7 @@ class _FriendModuleState extends State<FriendModule> {
left: 6.0,
right: 6.0,
child: Visibility(
visible: videoModuleController.videoPlayIndex.value == index && position > Duration.zero,
visible: videoModuleController.videoPlayFriend.value == index && position > Duration.zero,
child: Listener(
child: SliderTheme(
data: SliderThemeData(