Merge branch 'main' into fix

This commit is contained in:
guozhigq
2024-12-10 19:35:53 +08:00
4 changed files with 52 additions and 60 deletions

View File

@ -194,26 +194,31 @@ class _LivePageState extends State<LivePage>
),
),
),
InkWell(
onTap: () {
Get.toNamed('/liveFollowing');
},
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
child: Row(
children: [
Text(
'查看更多',
style: TextStyle(
fontSize: 14,
color: Theme.of(context).colorScheme.outline,
),
Obx(
() => Visibility(
visible: _liveController.liveFollowingCount.value > 0,
child: InkWell(
onTap: () {
Get.toNamed('/liveFollowing');
},
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
child: Row(
children: [
Text(
'查看更多',
style: TextStyle(
fontSize: 14,
color: Theme.of(context).colorScheme.outline,
),
),
Icon(
Icons.chevron_right,
color: Theme.of(context).colorScheme.outline,
),
],
),
Icon(
Icons.chevron_right,
color: Theme.of(context).colorScheme.outline,
),
],
),
),
),
],
@ -222,19 +227,18 @@ class _LivePageState extends State<LivePage>
future: _futureBuilderFuture2,
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.data == null) {
return const SizedBox();
}
Map? data = snapshot.data;
if (data?['status']) {
if (data != null && data['status']) {
RxList list = _liveController.liveFollowingList;
return LiveFollowingListView(list: list);
return list.isNotEmpty
? LiveFollowingListView(list: list)
: const Center(child: Text('没有人在直播'));
} else {
return SizedBox(
height: 80,
child: Center(
child: Text(
data?['msg'] ?? '',
data?['msg'] ?? '请求异常',
style: TextStyle(
color: Theme.of(context).colorScheme.outline,
fontSize: 12,
@ -283,6 +287,15 @@ class LiveFollowingListView extends StatelessWidget {
},
);
},
onLongPress: () {
Get.toNamed(
'/member?mid=${list[index].uid}',
arguments: {
'face': list[index].face,
'heroTag': list[index].uid.toString(),
},
);
},
child: Container(
width: 54,
height: 54,

View File

@ -9,7 +9,7 @@ class LiveFollowController extends GetxController {
RxInt crossAxisCount = 2.obs;
Box setting = GStorage.setting;
int _currentPage = 1;
RxInt liveFollowingCount = 0.obs;
RxString liveFollowingCount = '- '.obs;
RxList<LiveFollowingItemModel> liveFollowingList =
<LiveFollowingItemModel>[].obs;
@ -28,10 +28,11 @@ class LiveFollowController extends GetxController {
if (res['status']) {
if (type == 'init') {
liveFollowingList.value = res['data'].list;
liveFollowingCount.value = res['data'].liveCount;
liveFollowingCount.value = res['data'].liveCount.toString();
} else if (type == 'onLoad') {
liveFollowingList.addAll(res['data'].list);
}
liveFollowingList.removeWhere((e) => e.liveStatus != 1);
_currentPage += 1;
} else {
SmartDialog.showToast(res['msg']);

View File

@ -1080,10 +1080,7 @@ class _HeaderControlState extends State<HeaderControl> {
if (videoIntroController.isShowOnlineTotal)
Text(
'${videoIntroController.total.value}人正在看',
style: const TextStyle(
color: Colors.white,
fontSize: 12,
),
style: textStyle,
),
const Spacer(),
Expanded(
@ -1094,18 +1091,12 @@ class _HeaderControlState extends State<HeaderControl> {
builder: (context, snapshot) {
if (snapshot.hasData) {
String currentTime = _formatTime(snapshot.data!);
return Text(
currentTime,
style: const TextStyle(fontSize: 12),
);
return Text(currentTime, style: textStyle);
} else if (snapshot.connectionState ==
ConnectionState.waiting) {
// 如果Stream还未发出数据先显示初始获取的时间
String currentTime = _formatTime(initialTime);
return Text(
currentTime,
style: const TextStyle(fontSize: 12),
);
return Text(currentTime, style: textStyle);
} else {
return const SizedBox();
}
@ -1156,7 +1147,8 @@ class _HeaderControlState extends State<HeaderControl> {
() => Marquee(
text: videoIntroController.videoDetail.value.title ??
'',
style: const TextStyle(fontSize: 16),
style: const TextStyle(
fontSize: 16, color: Colors.white),
scrollAxis: Axis.horizontal,
crossAxisAlignment: CrossAxisAlignment.center,
blankSpace: constraints.maxWidth,

View File

@ -292,10 +292,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
style: ButtonStyle(
padding: MaterialStateProperty.all(EdgeInsets.zero),
),
child: const Text(
'选集',
style: TextStyle(color: Colors.white, fontSize: 13),
),
child: const Text('选集', style: textStyle),
),
),
@ -310,14 +307,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
padding: MaterialStateProperty.all(EdgeInsets.zero),
),
child: Obx(
() => Text(
_.videoFitDEsc.value,
style: const TextStyle(
color: Colors.white,
fontSize: 12,
fontWeight: FontWeight.bold,
),
),
() => Text(_.videoFitDEsc.value, style: textStyle),
),
),
),
@ -339,10 +329,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
height: 40,
padding: const EdgeInsets.only(left: 20),
value: speed,
child: Text(
'${speed}x',
style: textStyle.copyWith(fontWeight: FontWeight.bold),
),
child: Text('${speed}x', style: textStyle),
);
}).toList();
},
@ -352,10 +339,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
alignment: Alignment.center,
margin: const EdgeInsets.only(right: 4),
child: Obx(
() => Text(
'${_.playbackSpeed.toString()}x',
style: textStyle.copyWith(fontWeight: FontWeight.bold),
),
() => Text('${_.playbackSpeed.toString()}x', style: textStyle),
),
),
),
@ -734,6 +718,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
lastFullScreenToggleTime = DateTime.now();
// 下滑退出全屏
await widget.controller.triggerFullScreen(status: flag);
widget.fullScreenCb?.call(flag);
}
_distance.value = 0.0;
} else if (dy < _distance.value &&
@ -743,6 +728,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
lastFullScreenToggleTime = DateTime.now();
// 上滑进入全屏
await widget.controller.triggerFullScreen(status: !flag);
widget.fullScreenCb?.call(!flag);
}
_distance.value = 0.0;
}