feat(flutter): 重设计播放页与操作面板
This commit is contained in:
1 parent
148fbc3c93
commit
9a4269b847
24 files changed
+2395
-1101
No files matched your search
@@ -0,0 +1,117 @@
|
||||
// Author: fruit.com.cn
|
||||
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:video_player/video_player.dart';
|
||||
|
||||
import '../../../core/data/models/drama.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
|
||||
/// 播放浮层展示数据。
|
||||
class PlayerOverlayData {
|
||||
/// 创建播放浮层数据。
|
||||
const PlayerOverlayData({
|
||||
required this.l10n,
|
||||
required this.drama,
|
||||
required this.episode,
|
||||
required this.controller,
|
||||
required this.liked,
|
||||
required this.likeCount,
|
||||
required this.saved,
|
||||
required this.playing,
|
||||
required this.textScale,
|
||||
required this.currentIndex,
|
||||
required this.totalEpisodes,
|
||||
});
|
||||
|
||||
/// 当前语言包。
|
||||
final AppLocalizations l10n;
|
||||
|
||||
/// 当前短剧。
|
||||
final Drama drama;
|
||||
|
||||
/// 当前剧集。
|
||||
final Episode episode;
|
||||
|
||||
/// 当前播放器。
|
||||
final VideoPlayerController? controller;
|
||||
|
||||
/// 是否已点赞。
|
||||
final bool liked;
|
||||
|
||||
/// 点赞数;未知时隐藏。
|
||||
final int? likeCount;
|
||||
|
||||
/// 是否已收藏。
|
||||
final bool saved;
|
||||
|
||||
/// 是否处于播放状态。
|
||||
final bool playing;
|
||||
|
||||
/// 信息文字缩放比例。
|
||||
final double textScale;
|
||||
|
||||
/// 当前集索引。
|
||||
final int currentIndex;
|
||||
|
||||
/// 可见集数量。
|
||||
final int totalEpisodes;
|
||||
}
|
||||
|
||||
/// 播放浮层动作集合。
|
||||
class PlayerOverlayActions {
|
||||
/// 创建动作集合。
|
||||
const PlayerOverlayActions({
|
||||
required this.onBack,
|
||||
required this.onTogglePlay,
|
||||
required this.onClear,
|
||||
required this.onExitClear,
|
||||
required this.onEpisodes,
|
||||
required this.onComments,
|
||||
required this.onLike,
|
||||
required this.onSave,
|
||||
required this.onShare,
|
||||
required this.onMore,
|
||||
required this.onScrubStart,
|
||||
required this.onSeek,
|
||||
this.onNext,
|
||||
});
|
||||
|
||||
/// 返回上一页。
|
||||
final VoidCallback? onBack;
|
||||
|
||||
/// 切换播放状态。
|
||||
final VoidCallback onTogglePlay;
|
||||
|
||||
/// 进入清屏。
|
||||
final VoidCallback onClear;
|
||||
|
||||
/// 退出清屏。
|
||||
final VoidCallback onExitClear;
|
||||
|
||||
/// 打开选集。
|
||||
final VoidCallback onEpisodes;
|
||||
|
||||
/// 打开评论。
|
||||
final VoidCallback onComments;
|
||||
|
||||
/// 切换点赞。
|
||||
final VoidCallback onLike;
|
||||
|
||||
/// 切换收藏。
|
||||
final VoidCallback onSave;
|
||||
|
||||
/// 分享。
|
||||
final VoidCallback onShare;
|
||||
|
||||
/// 打开更多面板。
|
||||
final VoidCallback onMore;
|
||||
|
||||
/// 下一集。
|
||||
final VoidCallback? onNext;
|
||||
|
||||
/// 开始拖动进度。
|
||||
final VoidCallback? onScrubStart;
|
||||
|
||||
/// 提交进度跳转。
|
||||
final Future<void> Function(Duration)? onSeek;
|
||||
}
|
||||
Reference in new issue
Block a user