opt: danmaku bottomsheet

Closes #74

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-12-30 18:15:28 +08:00
parent 52f9b0f83c
commit 2973299e29
2 changed files with 12 additions and 9 deletions

View File

@@ -123,6 +123,8 @@ class _HeaderControlState extends State<HeaderControl> {
showModalBottomSheet( showModalBottomSheet(
elevation: 0, elevation: 0,
context: context, context: context,
isScrollControlled: true,
clipBehavior: Clip.hardEdge,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
builder: (context) { builder: (context) {
return Container( return Container(
@@ -504,8 +506,6 @@ class _HeaderControlState extends State<HeaderControl> {
), ),
); );
}, },
clipBehavior: Clip.hardEdge,
isScrollControlled: true,
); );
} }
@@ -1051,13 +1051,14 @@ class _HeaderControlState extends State<HeaderControl> {
await showModalBottomSheet( await showModalBottomSheet(
context: context, context: context,
elevation: 0, elevation: 0,
isScrollControlled: true,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
builder: (BuildContext context) { builder: (BuildContext context) {
return StatefulBuilder( return StatefulBuilder(
builder: (BuildContext context, StateSetter setState) { builder: (BuildContext context, StateSetter setState) {
return Container( return Container(
width: double.infinity, width: double.infinity,
height: 600, height: Get.height / 2,
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface, color: Theme.of(context).colorScheme.surface,

View File

@@ -239,10 +239,12 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
videoIntroController!.videoDetail.value.pages!.length > 1; videoIntroController!.videoDetail.value.pages!.length > 1;
bool isBangumi = bangumiIntroController?.loadingState.value is Success; bool isBangumi = bangumiIntroController?.loadingState.value is Success;
bool anySeason = isSeason || isPage || isBangumi; bool anySeason = isSeason || isPage || isBangumi;
double widgetWidth =
isFullScreen && context.orientation == Orientation.landscape ? 42 : 35;
Map<BottomControlType, Widget> videoProgressWidgets = { Map<BottomControlType, Widget> videoProgressWidgets = {
/// 上一集 /// 上一集
BottomControlType.pre: Container( BottomControlType.pre: Container(
width: isFullScreen ? 42 : 35, width: widgetWidth,
height: 30, height: 30,
alignment: Alignment.center, alignment: Alignment.center,
child: ComBtn( child: ComBtn(
@@ -274,7 +276,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
/// 下一集 /// 下一集
BottomControlType.next: Container( BottomControlType.next: Container(
width: isFullScreen ? 42 : 35, width: widgetWidth,
height: 30, height: 30,
alignment: Alignment.center, alignment: Alignment.center,
child: ComBtn( child: ComBtn(
@@ -341,7 +343,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
() => plPlayerController.viewPointList.isEmpty () => plPlayerController.viewPointList.isEmpty
? const SizedBox.shrink() ? const SizedBox.shrink()
: Container( : Container(
width: isFullScreen ? 42 : 35, width: widgetWidth,
height: 30, height: 30,
alignment: Alignment.center, alignment: Alignment.center,
child: ComBtn( child: ComBtn(
@@ -361,7 +363,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
/// 选集 /// 选集
BottomControlType.episode: Container( BottomControlType.episode: Container(
width: isFullScreen ? 42 : 35, width: widgetWidth,
height: 30, height: 30,
alignment: Alignment.center, alignment: Alignment.center,
child: ComBtn( child: ComBtn(
@@ -450,7 +452,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
() => plPlayerController.vttSubtitles.isEmpty () => plPlayerController.vttSubtitles.isEmpty
? const SizedBox.shrink() ? const SizedBox.shrink()
: SizedBox( : SizedBox(
width: isFullScreen ? 42 : 35, width: widgetWidth,
height: 30, height: 30,
child: PopupMenuButton<int>( child: PopupMenuButton<int>(
onSelected: (int value) { onSelected: (int value) {
@@ -523,7 +525,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
/// 全屏 /// 全屏
BottomControlType.fullscreen: SizedBox( BottomControlType.fullscreen: SizedBox(
width: isFullScreen ? 42 : 35, width: widgetWidth,
height: 30, height: 30,
child: Obx(() => ComBtn( child: Obx(() => ComBtn(
icon: Icon( icon: Icon(