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

@@ -44,7 +44,7 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget {
size: 18, size: 18,
color: Colors.white, color: Colors.white,
), ),
fuc: onRefresh, onTap: onRefresh,
), ),
// // ComBtn( // // ComBtn(
// icon: const Icon( // icon: const Icon(
@@ -192,7 +192,7 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget {
size: 20, size: 20,
color: Colors.white, color: Colors.white,
), ),
fuc: () => plPlayerController.triggerFullScreen( onTap: () => plPlayerController.triggerFullScreen(
status: !plPlayerController.isFullScreen.value), status: !plPlayerController.isFullScreen.value),
), ),
], ],

View File

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

View File

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

View File

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