mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-04-20 23:22:07 +00:00
Implement QOL-feature
If the last episode of an Anime has ended, exit fullscreen mode.
This commit is contained in:
parent
3a1d568a42
commit
7c5a7cb2e5
1 changed files with 7 additions and 2 deletions
|
|
@ -266,13 +266,19 @@ class _AnimeStreamPageState extends riv.ConsumerState<AnimeStreamPage>
|
|||
_currentTotalDuration.value = duration;
|
||||
});
|
||||
|
||||
bool get hasNextEpisode => _streamController.getEpisodeIndex().$1 != 0;
|
||||
|
||||
late final StreamSubscription<bool> _completed = _player.stream.completed
|
||||
.listen((val) {
|
||||
if (_streamController.getEpisodeIndex().$1 != 0 && val == true) {
|
||||
if (hasNextEpisode && val) {
|
||||
if (mounted) {
|
||||
pushToNewEpisode(context, _streamController.getNextEpisode());
|
||||
}
|
||||
}
|
||||
// If the last episode of an Anime has ended, exit fullscreen mode
|
||||
if (!hasNextEpisode && val && _isDesktop && !_enterFullScreen.value) {
|
||||
setFullScreen(value: false);
|
||||
}
|
||||
});
|
||||
|
||||
void pushToNewEpisode(BuildContext context, Chapter episode) {
|
||||
|
|
@ -839,7 +845,6 @@ class _AnimeStreamPageState extends riv.ConsumerState<AnimeStreamPage>
|
|||
_streamController.getEpisodesLength(
|
||||
_streamController.getEpisodeIndex().$2,
|
||||
);
|
||||
bool hasNextEpisode = _streamController.getEpisodeIndex().$1 != 0;
|
||||
final skipDuration = ref.watch(defaultDoubleTapToSkipLengthStateProvider);
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
|
|
|
|||
Loading…
Reference in a new issue