This commit is contained in:
rang 2025-12-29 17:56:03 +08:00
parent 6ffd76a194
commit b0f5dd8951
18 changed files with 441 additions and 64 deletions

View file

@ -275,7 +275,7 @@ final playerStateProvider =
);
typedef _$PlayerState = AutoDisposeNotifier<core.AbsPlayerState>;
String _$currentBookHash() => r'b4f6b6ccc772631db3dfd9070be3d7487333544d';
String _$currentBookHash() => r'790af1f9502b12879fc22c900ed5e3572381ab1e';
/// See also [CurrentBook].
@ProviderFor(CurrentBook)

View file

@ -101,7 +101,9 @@ class PlayerExpandedDesktop extends HookConsumerWidget {
),
),
),
child: ChapterSelectionModal(),
child: ChapterSelectionModal(
back: false,
),
),
),
],

View file

@ -49,7 +49,9 @@ class ChapterSelectionButton extends HookConsumerWidget {
class ChapterSelectionModal extends HookConsumerWidget {
const ChapterSelectionModal({
super.key,
this.back = true,
});
final bool back;
@override
Widget build(BuildContext context, WidgetRef ref) {
@ -108,8 +110,11 @@ class ChapterSelectionModal extends HookConsumerWidget {
: const Icon(Icons.play_arrow),
selected: isCurrent,
onTap: () {
Navigator.of(context).pop();
ref.read(absPlayerProvider).switchChapter(chapter.id);
if (back) {
Navigator.of(context).pop();
} else {
ref.read(absPlayerProvider).switchChapter(chapter.id);
}
},
);
},