opt uplist item

end align player duration

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-07-25 14:49:33 +08:00
parent d567c296f8
commit d17dbe139e
5 changed files with 22 additions and 26 deletions

View File

@@ -20,29 +20,28 @@ class UpPanel extends StatefulWidget {
}
class _UpPanelState extends State<UpPanel> {
late final isTop =
widget.dynamicsController.upPanelPosition == UpPanelPosition.top;
late final controller = widget.dynamicsController;
late final isTop = controller.upPanelPosition == UpPanelPosition.top;
@override
Widget build(BuildContext context) {
final accountService = widget.dynamicsController.accountService;
final accountService = controller.accountService;
if (!accountService.isLogin.value) {
return const SizedBox.shrink();
}
final theme = Theme.of(context);
final upData = widget.dynamicsController.upData.value;
final upData = controller.upData.value;
final List<UpItem>? upList = upData.upList;
final List<LiveUserItem>? liveList = upData.liveUsers?.items;
return CustomScrollView(
scrollDirection: isTop ? Axis.horizontal : Axis.vertical,
physics: const AlwaysScrollableScrollPhysics(),
controller: widget.dynamicsController.scrollController,
controller: controller.scrollController,
slivers: [
SliverToBoxAdapter(
child: InkWell(
onTap: () => setState(() {
widget.dynamicsController.showLiveItems =
!widget.dynamicsController.showLiveItems;
controller.showLiveItems = !controller.showLiveItems;
}),
onLongPress: () => Get.to(const LiveFollowPage()),
child: Container(
@@ -65,7 +64,7 @@ class _UpPanelState extends State<UpPanel> {
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Icon(
widget.dynamicsController.showLiveItems
controller.showLiveItems
? Icons.expand_less
: Icons.expand_more,
size: 12,
@@ -76,7 +75,7 @@ class _UpPanelState extends State<UpPanel> {
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Icon(
widget.dynamicsController.showLiveItems
controller.showLiveItems
? Icons.keyboard_arrow_right
: Icons.keyboard_arrow_left,
color: theme.colorScheme.primary,
@@ -89,8 +88,7 @@ class _UpPanelState extends State<UpPanel> {
),
),
),
if (widget.dynamicsController.showLiveItems &&
liveList?.isNotEmpty == true)
if (controller.showLiveItems && liveList?.isNotEmpty == true)
SliverList.builder(
itemCount: liveList!.length,
itemBuilder: (context, index) {
@@ -125,7 +123,7 @@ class _UpPanelState extends State<UpPanel> {
}
void _onSelect(UserItem data) {
widget.dynamicsController
controller
..currentMid = data.mid
..onSelectUp(data.mid);
@@ -135,10 +133,9 @@ class _UpPanelState extends State<UpPanel> {
}
Widget upItemBuild(ThemeData theme, UserItem data) {
bool isCurrent =
widget.dynamicsController.currentMid == data.mid ||
widget.dynamicsController.currentMid == -1;
final currentMid = controller.currentMid;
final isLive = data is LiveUserItem;
bool isCurrent = isLive || currentMid == data.mid || currentMid == -1;
return SizedBox(
height: 76,
width: isTop ? 70 : null,
@@ -153,7 +150,7 @@ class _UpPanelState extends State<UpPanel> {
Get.toNamed('/liveRoom?roomid=${data.roomId}');
}
},
onDoubleTap: data is LiveUserItem ? () => _onSelect(data) : null,
onDoubleTap: isLive ? () => _onSelect(data) : null,
onLongPress: data.mid == -1
? null
: () => Get.toNamed('/member?mid=${data.mid}'),
@@ -192,9 +189,7 @@ class _UpPanelState extends State<UpPanel> {
label: isLive ? const Text(' Live ') : null,
textColor: theme.colorScheme.onSecondaryContainer,
alignment: AlignmentDirectional.topStart,
isLabelVisible:
isLive ||
(data is UpItem && (data.hasUpdate ?? false)),
isLabelVisible: isLive || (data.hasUpdate ?? false),
backgroundColor: isLive
? theme.colorScheme.secondaryContainer.withValues(
alpha: 0.75,
@@ -212,7 +207,7 @@ class _UpPanelState extends State<UpPanel> {
maxLines: 2,
textAlign: TextAlign.center,
style: TextStyle(
color: widget.dynamicsController.currentMid == data.mid
color: currentMid == data.mid
? theme.colorScheme.primary
: theme.colorScheme.outline,
height: 1.1,

View File

@@ -56,7 +56,7 @@ class _SearchPageState extends State<SearchPage> {
),
IconButton(
tooltip: '搜索',
onPressed: () => _searchController.submit(),
onPressed: _searchController.submit,
icon: const Icon(Icons.search, size: 22),
),
const SizedBox(width: 10),

View File

@@ -528,7 +528,7 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
selectStatus: videoIntroController.hasLike.value,
semanticsLabel: '点赞',
text: !isLoading
? NumUtil.numFormat(videoDetail.stat!.like!)
? NumUtil.numFormat(videoDetail.stat!.like)
: null,
needAnim: true,
hasTriple:
@@ -566,7 +566,7 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
selectStatus: videoIntroController.hasCoin,
semanticsLabel: '投币',
text: !isLoading
? NumUtil.numFormat(videoDetail.stat!.coin!)
? NumUtil.numFormat(videoDetail.stat!.coin)
: null,
needAnim: true,
),
@@ -584,7 +584,7 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
selectStatus: videoIntroController.hasFav.value,
semanticsLabel: '收藏',
text: !isLoading
? NumUtil.numFormat(videoDetail.stat!.favorite!)
? NumUtil.numFormat(videoDetail.stat!.favorite)
: null,
needAnim: true,
),

View File

@@ -472,10 +472,10 @@ class PlPlayerController {
enableHeart = false;
}
if (Platform.isAndroid) {
if (Platform.isAndroid && autoPiP) {
Utils.channel.setMethodCallHandler((call) async {
if (call.method == 'onUserLeaveHint') {
if (autoPiP && playerStatus.status.value == PlayerStatus.playing) {
if (playerStatus.status.value == PlayerStatus.playing) {
enterPip();
}
}

View File

@@ -317,6 +317,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
/// 时间进度
BottomControlType.time: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
// 播放时间
Obx(() {