opt: video sheet

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-06 15:49:40 +08:00
parent f9b844fb1a
commit a8daf02610
6 changed files with 1504 additions and 1576 deletions

View File

@@ -47,7 +47,7 @@ class PLVideoPlayer extends StatefulWidget {
this.videoDetailController,
this.videoIntroController,
this.bangumiIntroController,
this.headerControl,
required this.headerControl,
this.bottomControl,
this.danmuWidget,
this.customWidget,
@@ -63,7 +63,7 @@ class PLVideoPlayer extends StatefulWidget {
final VideoDetailController? videoDetailController;
final VideoIntroController? videoIntroController;
final BangumiIntroController? bangumiIntroController;
final PreferredSizeWidget? headerControl;
final PreferredSizeWidget headerControl;
final PreferredSizeWidget? bottomControl;
final Widget? danmuWidget;
// List<Widget> or Widget
@@ -170,9 +170,6 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
videoController = plPlayerController.videoController!;
videoIntroController = widget.videoIntroController;
bangumiIntroController = widget.bangumiIntroController;
plPlayerController.headerControl = widget.headerControl;
plPlayerController.bottomControl = widget.bottomControl;
plPlayerController.danmuWidget = widget.danmuWidget;
defaultBtmProgressBehavior = GStorage.setting.get(
SettingBoxKey.btmProgressBehavior,
defaultValue: BtmProgressBehavior.values.first.code);
@@ -1289,29 +1286,25 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
child: ClipRect(
child: Column(
children: [
if (widget.headerControl != null ||
plPlayerController.headerControl != null)
AppBarAni(
controller: animationController,
visible: !plPlayerController.controlsLock.value &&
plPlayerController.showControls.value,
position: 'top',
child: widget.headerControl ??
plPlayerController.headerControl!,
),
AppBarAni(
controller: animationController,
visible: !plPlayerController.controlsLock.value &&
plPlayerController.showControls.value,
position: 'top',
child: widget.headerControl,
),
const Spacer(),
if (plPlayerController.showControls.value)
AppBarAni(
controller: animationController,
visible: !plPlayerController.controlsLock.value &&
plPlayerController.showControls.value,
position: 'bottom',
child: widget.bottomControl ??
BottomControl(
controller: plPlayerController,
buildBottomControl: buildBottomControl,
),
),
AppBarAni(
controller: animationController,
visible: !plPlayerController.controlsLock.value &&
plPlayerController.showControls.value,
position: 'bottom',
child: widget.bottomControl ??
BottomControl(
controller: plPlayerController,
buildBottomControl: buildBottomControl,
),
),
],
),
),