fix(flutter): 底栏右侧改为清屏
This commit is contained in:
1 parent
9429257d62
commit
1666bc220e
7 files changed
+51
-18
No files matched your search
@@ -18,6 +18,7 @@ class PlayerMoreState {
|
||||
required this.speed,
|
||||
required this.qualities,
|
||||
required this.textScale,
|
||||
required this.pipAvailable,
|
||||
});
|
||||
|
||||
/// 当前倍速。
|
||||
@@ -28,6 +29,9 @@ class PlayerMoreState {
|
||||
|
||||
/// 当前文字缩放比例。
|
||||
final double textScale;
|
||||
|
||||
/// 设备是否提供画中画入口。
|
||||
final bool pipAvailable;
|
||||
}
|
||||
|
||||
/// 更多面板动作集合。
|
||||
@@ -39,6 +43,7 @@ class PlayerMoreActions {
|
||||
required this.onClear,
|
||||
required this.onDownload,
|
||||
required this.onReport,
|
||||
this.onPip,
|
||||
});
|
||||
|
||||
/// 倍速变化。
|
||||
@@ -55,6 +60,9 @@ class PlayerMoreActions {
|
||||
|
||||
/// 投诉当前剧。
|
||||
final VoidCallback onReport;
|
||||
|
||||
/// 进入画中画;平台不支持时为空。
|
||||
final VoidCallback? onPip;
|
||||
}
|
||||
|
||||
/// K29 播放页白色更多面板。
|
||||
@@ -136,6 +144,13 @@ class _PlayerMoreSheetState extends State<PlayerMoreSheet> {
|
||||
title: l10n.offlineCache,
|
||||
onTap: () => _closeThen(widget.actions.onDownload),
|
||||
),
|
||||
if (widget.state.pipAvailable && widget.actions.onPip != null)
|
||||
_enabledRow(
|
||||
key: const Key('player-more-pip'),
|
||||
icon: Icons.picture_in_picture_alt_rounded,
|
||||
title: l10n.pictureInPicture,
|
||||
onTap: () => _closeThen(widget.actions.onPip!),
|
||||
),
|
||||
_textSizeRow(l10n),
|
||||
_disabledRow(
|
||||
key: const Key('player-more-cast'),
|
||||
|
||||
@@ -281,14 +281,13 @@ class PlayerPlaybackOverlay extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (actions.onPip != null) ...[
|
||||
const SizedBox(width: 8),
|
||||
_PipButton(
|
||||
key: const Key('player-pip'),
|
||||
tooltip: data.l10n.pictureInPicture,
|
||||
onPressed: actions.onPip!,
|
||||
),
|
||||
],
|
||||
const SizedBox(width: 8),
|
||||
_BottomIconButton(
|
||||
key: const Key('player-bottom-clear-screen'),
|
||||
tooltip: data.l10n.clearScreen,
|
||||
icon: Icons.fullscreen_rounded,
|
||||
onPressed: actions.onClear,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,6 @@ class PlayerOverlayActions {
|
||||
required this.onMore,
|
||||
required this.onScrubStart,
|
||||
required this.onSeek,
|
||||
this.onPip,
|
||||
});
|
||||
|
||||
/// 返回上一页。
|
||||
@@ -131,7 +130,4 @@ class PlayerOverlayActions {
|
||||
|
||||
/// 提交进度跳转。
|
||||
final Future<void> Function(Duration)? onSeek;
|
||||
|
||||
/// 进入小窗播放。
|
||||
final VoidCallback? onPip;
|
||||
}
|
||||
@@ -73,10 +73,16 @@ class _SpeedEntry extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _PipButton extends StatelessWidget {
|
||||
const _PipButton({super.key, required this.tooltip, required this.onPressed});
|
||||
class _BottomIconButton extends StatelessWidget {
|
||||
const _BottomIconButton({
|
||||
super.key,
|
||||
required this.tooltip,
|
||||
required this.icon,
|
||||
required this.onPressed,
|
||||
});
|
||||
|
||||
final String tooltip;
|
||||
final IconData icon;
|
||||
final VoidCallback onPressed;
|
||||
|
||||
@override
|
||||
@@ -91,7 +97,7 @@ class _PipButton extends StatelessWidget {
|
||||
foregroundColor: AppColors.onSurface,
|
||||
),
|
||||
onPressed: onPressed,
|
||||
icon: const Icon(Icons.picture_in_picture_alt_rounded, size: 17),
|
||||
icon: Icon(icon, size: 17),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user