downloads and offline playback

This commit is contained in:
Dr-Blank 2024-08-20 08:36:39 -04:00
parent 1c95d1e4bb
commit c24541f1cd
No known key found for this signature in database
GPG key ID: 7452CC63F210A266
38 changed files with 1590 additions and 109 deletions

View file

@ -17,6 +17,8 @@ import 'widgets/audiobook_player_seek_button.dart';
import 'widgets/audiobook_player_seek_chapter_button.dart';
import 'widgets/player_speed_adjust_button.dart';
var pendingPlayerModals = 0;
class PlayerWhenExpanded extends HookConsumerWidget {
const PlayerWhenExpanded({
super.key,
@ -270,6 +272,7 @@ class SleepTimerButton extends HookConsumerWidget {
message: 'Sleep Timer',
child: InkWell(
onTap: () async {
pendingPlayerModals++;
// show the sleep timer dialog
final resultingDuration = await showDurationPicker(
context: context,
@ -279,6 +282,7 @@ class SleepTimerButton extends HookConsumerWidget {
.sleepTimerSettings
.defaultDuration,
);
pendingPlayerModals--;
if (resultingDuration != null) {
// if 0 is selected, cancel the timer
if (resultingDuration.inSeconds == 0) {