mod: handle show viewpoints btn

Closes #457

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-03-16 11:20:55 +08:00
parent c2e9a7deb3
commit 0b8e95477c
4 changed files with 26 additions and 17 deletions

View File

@@ -303,7 +303,9 @@ class PlPlayerController {
wordSpacing: 0.1,
color: Colors.white,
fontWeight: FontWeight.normal,
backgroundColor: Colors.black.withOpacity(subtitleBgOpaticy),
backgroundColor: subtitleBgOpaticy == 0
? null
: Colors.black.withOpacity(subtitleBgOpaticy),
);
SubtitleViewConfiguration get subtitleViewConfiguration =>

View File

@@ -274,7 +274,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
size: 22,
color: Colors.white,
),
fuc: () {
onTap: () {
bool? res;
if (videoIntroController != null) {
res = videoIntroController!.prevPlay();
@@ -306,7 +306,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
size: 22,
color: Colors.white,
),
fuc: () {
onTap: () {
bool? res;
if (videoIntroController != null) {
res = videoIntroController!.nextPlay();
@@ -385,7 +385,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
),
],
),
fuc: () {
onTap: () {
plPlayerController.showDmChart.value =
!plPlayerController.showDmChart.value;
},
@@ -448,7 +448,11 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
color: Colors.white,
),
),
fuc: widget.showViewPoints,
onTap: widget.showViewPoints,
onLongPress: () {
plPlayerController.showVP.value =
!plPlayerController.showVP.value;
},
),
),
),
@@ -465,7 +469,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
size: 22,
color: Colors.white,
),
fuc: () {
onTap: () {
int? index;
int currentCid = plPlayerController.cid;
String bvid = plPlayerController.bvid;
@@ -629,7 +633,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
size: 24,
color: Colors.white,
),
fuc: () => plPlayerController.triggerFullScreen(
onTap: () => plPlayerController.triggerFullScreen(
status: !isFullScreen, duration: 800),
),
),
@@ -1516,7 +1520,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
size: 15,
color: Colors.white,
),
fuc: () => plPlayerController.onLockControl(
onTap: () => plPlayerController.onLockControl(
!plPlayerController.controlsLock.value),
),
),
@@ -1546,7 +1550,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
size: 20,
color: Colors.white,
),
fuc: () {
onTap: () {
SmartDialog.showToast('截图中');
plPlayerController.videoPlayerController
?.screenshot(format: 'image/png')

View File

@@ -1,12 +1,14 @@
import 'package:flutter/material.dart';
class ComBtn extends StatelessWidget {
final Widget? icon;
final GestureTapCallback? fuc;
final Widget icon;
final VoidCallback? onTap;
final VoidCallback? onLongPress;
const ComBtn({
this.icon,
this.fuc,
required this.icon,
this.onTap,
this.onLongPress,
super.key,
});
@@ -16,8 +18,9 @@ class ComBtn extends StatelessWidget {
width: 34,
height: 34,
child: GestureDetector(
onTap: fuc,
child: icon!,
onTap: onTap,
onLongPress: onLongPress,
child: icon,
),
);
}