feat(app): 完善播放协议搜索与空状态
This commit is contained in:
1 parent
671e0ce143
commit
ef29fc5f15
85 files changed
+2976
-768
No files matched your search
@@ -27,12 +27,14 @@ extension _PlayerViewActions on _PlayerPageState {
|
||||
state: PlayerMoreState(
|
||||
speed: _playbackSpeed,
|
||||
qualities: logic.qualities,
|
||||
selectedQuality: logic.selectedQuality,
|
||||
),
|
||||
actions: PlayerMoreActions(
|
||||
onSpeedChanged: (value) {
|
||||
_updatePlaybackSpeed(value);
|
||||
unawaited(logic.setPlaybackSpeed(value));
|
||||
},
|
||||
onQualityChanged: (quality) => _switchQuality(context, l10n, quality),
|
||||
onClear: _hideChrome,
|
||||
onDownload: () => requestEpisodeDownload(context, episode.id),
|
||||
onPip: logic.pictureInPicture.isPlatformSupported
|
||||
@@ -43,6 +45,19 @@ extension _PlayerViewActions on _PlayerPageState {
|
||||
);
|
||||
}
|
||||
|
||||
Future<bool> _switchQuality(
|
||||
BuildContext context,
|
||||
AppLocalizations l10n,
|
||||
String quality,
|
||||
) async {
|
||||
Navigator.of(context).pop();
|
||||
final switched = await logic.selectQuality(quality);
|
||||
if (!context.mounted || !switched) return false;
|
||||
final label = quality.toUpperCase() == 'AUTO' ? l10n.qualityAuto : quality;
|
||||
showCenteredToast(context, l10n.qualitySwitched(label));
|
||||
return true;
|
||||
}
|
||||
|
||||
Future<void> _openUnlockSheet(
|
||||
BuildContext context,
|
||||
int index,
|
||||
|
||||
Reference in new issue
Block a user