feat(flutter): 重构播放页并增加语言切换
This commit is contained in:
1 parent
f1efbc5be8
commit
8c43e9e385
34 files changed
+1331
-879
No files matched your search
@@ -15,15 +15,6 @@ extension _PlayerViewActions on _PlayerPageState {
|
||||
await logic.setPlaybackSpeed(selected);
|
||||
}
|
||||
|
||||
Future<void> _openQualitySheet(BuildContext context) async {
|
||||
await showModalBottomSheet<void>(
|
||||
context: context,
|
||||
backgroundColor: AppColors.card,
|
||||
showDragHandle: true,
|
||||
builder: (_) => QualitySheet(qualities: logic.qualities),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _openMore(
|
||||
BuildContext context,
|
||||
Drama drama,
|
||||
@@ -41,33 +32,21 @@ extension _PlayerViewActions on _PlayerPageState {
|
||||
speed: _playbackSpeed,
|
||||
qualities: logic.qualities,
|
||||
textScale: _textScale,
|
||||
pipAvailable: logic.pictureInPicture.isPlatformSupported,
|
||||
),
|
||||
actions: PlayerMoreActions(
|
||||
onSpeed: () => unawaited(_openSpeedSheet(context)),
|
||||
onQuality: () => unawaited(_openQualitySheet(context)),
|
||||
onSpeedChanged: (value) {
|
||||
_updatePlaybackSpeed(value);
|
||||
unawaited(logic.setPlaybackSpeed(value));
|
||||
},
|
||||
onTextScaleChanged: _updateTextScale,
|
||||
onClear: _hideChrome,
|
||||
onDownload: () => requestEpisodeDownload(context, episode.id),
|
||||
onTextSize: () => unawaited(_openTextSizeSheet(context)),
|
||||
onReport: () => unawaited(_reportDrama(context, drama, l10n)),
|
||||
onPip: logic.pictureInPicture.isPlatformSupported
|
||||
? () => unawaited(logic.enterPip(context))
|
||||
: null,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _openTextSizeSheet(BuildContext context) async {
|
||||
final selected = await showModalBottomSheet<double>(
|
||||
context: context,
|
||||
backgroundColor: Colors.transparent,
|
||||
showDragHandle: false,
|
||||
builder: (_) => PlayerTextSizeSheet(selected: _textScale),
|
||||
);
|
||||
if (selected == null || !mounted) return;
|
||||
_updateTextScale(selected);
|
||||
}
|
||||
|
||||
Future<void> _openUnlockSheet(
|
||||
BuildContext context,
|
||||
int index,
|
||||
|
||||
Reference in new issue
Block a user