Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-11-21 16:27:00 +08:00
parent a7e67796f1
commit c1d42b498a
10 changed files with 211 additions and 186 deletions

View File

@@ -345,6 +345,10 @@ class _LiveRoomPageState extends State<LiveRoomPage>
return PopScope(
canPop: !isFullScreen,
onPopInvokedWithResult: (bool didPop, Object? result) {
if (plPlayerController.controlsLock.value) {
plPlayerController.onLockControl(false);
return;
}
if (isFullScreen) {
plPlayerController.triggerFullScreen(status: false);
}

View File

@@ -120,7 +120,7 @@ class _BottomControlState extends State<BottomControl> with HeaderMixin {
CustomIcons.dm_settings,
color: Colors.white,
),
onTap: showSetDanmaku,
onTap: () => showSetDanmaku(isLive: true),
),
Obx(
() => PopupMenuButton<VideoFitType>(

View File

@@ -127,7 +127,7 @@ class LiveHeaderControl extends StatelessWidget {
}
if (await Floating().isPipAvailable) {
plPlayerController
..hiddenControls(false)
..showControls.value = false
..enterPip();
}
},

View File

@@ -162,10 +162,11 @@ class _AtMePageState extends State<AtMePage> {
),
],
),
trailing: item.item?.image != null && item.item?.image != ""
trailing: item.item?.image?.isNotEmpty == true
? NetworkImgLayer(
width: 45,
height: 45,
radius: 8,
src: item.item?.image,
)
: null,

View File

@@ -164,6 +164,38 @@ class _LikeMePageState extends State<LikeMePage> {
MsgLikeItem item,
ValueChanged<int?> onRemove,
) {
final firstUser = item.users!.first;
Widget avatar;
if (item.users!.length == 1) {
avatar = NetworkImgLayer(
width: 45,
height: 45,
type: ImageType.avatar,
src: firstUser.avatar,
);
} else {
avatar = SizedBox(
width: 45,
height: 45,
child: Stack(
clipBehavior: Clip.none,
children: [
for (var j = 0; j < item.users!.length && j < 4; j++) ...[
Positioned(
left: 15.0 * (j % 2),
top: 15.0 * (j ~/ 2),
child: NetworkImgLayer(
width: 30,
height: 30,
type: ImageType.avatar,
src: item.users![j].avatar,
),
),
],
],
),
);
}
void onLongPress() => showDialog(
context: context,
builder: (context) {
@@ -240,42 +272,12 @@ class _LikeMePageState extends State<LikeMePage> {
},
onLongPress: onLongPress,
onSecondaryTap: Utils.isMobile ? null : onLongPress,
leading: Column(
children: [
const Spacer(),
SizedBox(
width: 50,
height: 50,
child: Stack(
clipBehavior: Clip.none,
children: [
for (
var j = 0;
j < item.users!.length && j < 4;
j++
) ...<Widget>[
Positioned(
left: 15 * (j % 2).toDouble(),
top: 15 * (j ~/ 2).toDouble(),
child: NetworkImgLayer(
width: item.users!.length > 1 ? 30 : 45,
height: item.users!.length > 1 ? 30 : 45,
type: ImageType.avatar,
src: item.users![j].avatar,
),
),
],
],
),
),
const Spacer(),
],
),
leading: avatar,
title: Text.rich(
TextSpan(
children: [
TextSpan(
text: "${item.users![0].nickname}",
text: firstUser.nickname,
style: theme.textTheme.titleSmall!.copyWith(
height: 1.5,
color: theme.colorScheme.primary,
@@ -290,7 +292,7 @@ class _LikeMePageState extends State<LikeMePage> {
),
),
TextSpan(
text: " 赞了我的${item.item?.business}",
text: ' 赞了我的${item.item?.business}',
style: theme.textTheme.titleSmall!.copyWith(
height: 1.5,
color: theme.colorScheme.onSurfaceVariant,
@@ -333,6 +335,7 @@ class _LikeMePageState extends State<LikeMePage> {
NetworkImgLayer(
width: 45,
height: 45,
radius: 8,
src: item.item!.image,
),
if (item.noticeState == 1) ...[

View File

@@ -102,7 +102,7 @@ mixin HeaderMixin<T extends StatefulWidget> on State<T> {
}
/// 弹幕功能
void showSetDanmaku() {
void showSetDanmaku({bool isLive = false}) {
// 屏蔽类型
const List<({int value, String label})> blockTypesList = [
(value: 5, label: '顶部'),
@@ -278,49 +278,51 @@ mixin HeaderMixin<T extends StatefulWidget> on State<T> {
),
),
const SizedBox(height: 10),
Row(
children: [
Text('智能云屏蔽 $danmakuWeight'),
const Spacer(),
TextButton(
style: TextButton.styleFrom(
padding: EdgeInsets.zero,
minimumSize: Size.zero,
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
onPressed: () => Get
..back()
..toNamed(
'/danmakuBlock',
arguments: plPlayerController,
if (!isLive) ...[
Row(
children: [
Text('智能云屏蔽 $danmakuWeight'),
const Spacer(),
TextButton(
style: TextButton.styleFrom(
padding: EdgeInsets.zero,
minimumSize: Size.zero,
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
child: Text(
"屏蔽管理(${plPlayerController.filters.count})",
onPressed: () => Get
..back()
..toNamed(
'/danmakuBlock',
arguments: plPlayerController,
),
child: Text(
"屏蔽管理(${plPlayerController.filters.count})",
),
),
],
),
Padding(
padding: const EdgeInsets.only(
top: 0,
bottom: 6,
left: 10,
right: 10,
),
child: SliderTheme(
data: sliderTheme,
child: Slider(
min: 0,
max: 10,
value: danmakuWeight.toDouble(),
divisions: 10,
label: '$danmakuWeight',
onChanged: updateDanmakuWeight,
onChangeEnd: (_) =>
plPlayerController.putDanmakuSettings(),
),
),
],
),
Padding(
padding: const EdgeInsets.only(
top: 0,
bottom: 6,
left: 10,
right: 10,
),
child: SliderTheme(
data: sliderTheme,
child: Slider(
min: 0,
max: 10,
value: danmakuWeight.toDouble(),
divisions: 10,
label: '$danmakuWeight',
onChanged: updateDanmakuWeight,
onChangeEnd: (_) =>
plPlayerController.putDanmakuSettings(),
),
),
),
],
const Text('按类型屏蔽'),
Padding(
padding: const EdgeInsets.only(top: 12),
@@ -2290,8 +2292,8 @@ class HeaderControlState extends State<HeaderControl> with HeaderMixin {
return ListTile(
dense: true,
onTap: () {
plPlayerController.setPlayRepeat(i);
Get.back();
plPlayerController.setPlayRepeat(i);
},
contentPadding: const EdgeInsets.symmetric(
horizontal: 20,
@@ -2317,13 +2319,16 @@ class HeaderControlState extends State<HeaderControl> with HeaderMixin {
static final _format = DateFormat('HH:mm');
void startClock() {
clock ??= Timer.periodic(const Duration(seconds: 1), (Timer t) {
if (!mounted) {
cancelClock();
return;
}
if (clock == null) {
now.value = _format.format(DateTime.now());
});
clock = Timer.periodic(const Duration(seconds: 1), (Timer t) {
if (!mounted) {
cancelClock();
return;
}
now.value = _format.format(DateTime.now());
});
}
}
void cancelClock() {
@@ -2339,6 +2344,12 @@ class HeaderControlState extends State<HeaderControl> with HeaderMixin {
final isFSOrPip = isFullScreen || plPlayerController.isDesktopPip;
final showFSActionItem =
!isFileSource && plPlayerController.showFSActionItem && isFSOrPip;
final showCurrTime = !isPortrait && (isFullScreen || !horizontalScreen);
if (showCurrTime) {
startClock();
} else {
cancelClock();
}
return AppBar(
elevation: 0,
scrolledUnderElevation: 0,
@@ -2457,22 +2468,16 @@ class HeaderControlState extends State<HeaderControl> with HeaderMixin {
else
const Spacer(),
// show current datetime
Obx(
() {
if ((this.isFullScreen || !horizontalScreen) && !isPortrait) {
startClock();
return Text(
now.value,
style: const TextStyle(
color: Colors.white,
fontSize: 13,
),
);
}
cancelClock();
return const SizedBox.shrink();
},
),
if (showCurrTime)
Obx(
() => Text(
now.value,
style: const TextStyle(
color: Colors.white,
fontSize: 13,
),
),
),
if (!isFileSource) ...[
if (!isFSOrPip) ...[
if (videoDetailCtr.isUgc)
@@ -2629,7 +2634,7 @@ class HeaderControlState extends State<HeaderControl> with HeaderMixin {
return;
}
if (await Floating().isPipAvailable) {
plPlayerController.hiddenControls(false);
plPlayerController.showControls.value = false;
if (context.mounted &&
!videoPlayerServiceHandler!.enableBackgroundPlay) {
final theme = Theme.of(context);

View File

@@ -158,12 +158,16 @@ class PlayerFocus extends StatelessWidget {
return true;
case LogicalKeyboardKey.keyF:
plPlayerController
..triggerFullScreen(
status: !isFullScreen,
inAppFullScreen: HardwareKeyboard.instance.isShiftPressed,
)
..controlsLock.value = false;
final isFullScreen = this.isFullScreen;
if (isFullScreen && plPlayerController.controlsLock.value) {
plPlayerController
..controlsLock.value = false
..showControls.value = false;
}
plPlayerController.triggerFullScreen(
status: !isFullScreen,
inAppFullScreen: HardwareKeyboard.instance.isShiftPressed,
);
return true;
case LogicalKeyboardKey.keyD:
@@ -183,7 +187,8 @@ class PlayerFocus extends StatelessWidget {
if (Utils.isDesktop && hasPlayer && !isFullScreen) {
plPlayerController
..toggleDesktopPip()
..controlsLock.value = false;
..controlsLock.value = false
..showControls.value = false;
}
return true;