fix(flutter): 更多面板增加小窗播放入口
This commit is contained in:
1 parent
3b2bdb8e5a
commit
0af5de9641
4 files changed
+115
-1
No files matched your search
@@ -35,6 +35,9 @@ extension _PlayerViewActions on _PlayerPageState {
|
||||
},
|
||||
onClear: _hideChrome,
|
||||
onDownload: () => requestEpisodeDownload(context, episode.id),
|
||||
onPip: logic.pictureInPicture.isPlatformSupported
|
||||
? () => unawaited(logic.enterPip(context))
|
||||
: null,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -35,6 +35,7 @@ class PlayerMoreActions {
|
||||
required this.onSpeedChanged,
|
||||
required this.onClear,
|
||||
required this.onDownload,
|
||||
this.onPip,
|
||||
});
|
||||
|
||||
/// 倍速变化。
|
||||
@@ -45,6 +46,9 @@ class PlayerMoreActions {
|
||||
|
||||
/// 离线缓存当前集。
|
||||
final VoidCallback onDownload;
|
||||
|
||||
/// 进入小窗播放;平台不支持时为 null。
|
||||
final VoidCallback? onPip;
|
||||
}
|
||||
|
||||
/// K29.6 精简版播放页更多面板。
|
||||
@@ -113,6 +117,13 @@ class _PlayerMoreSheetState extends State<PlayerMoreSheet> {
|
||||
title: l10n.clearPlayback,
|
||||
onTap: _clear,
|
||||
),
|
||||
if (widget.actions.onPip != null)
|
||||
_actionRow(
|
||||
key: const Key('player-more-pip'),
|
||||
icon: Icons.picture_in_picture_alt_rounded,
|
||||
title: l10n.pictureInPicture,
|
||||
onTap: () => _closeThen(widget.actions.onPip!),
|
||||
),
|
||||
_actionRow(
|
||||
key: const Key('player-more-offline'),
|
||||
icon: Icons.download_rounded,
|
||||
|
||||
Reference in new issue
Block a user