更改跳过首尾方式

This commit is contained in:
rang 2025-12-18 16:46:25 +08:00
parent 5abf938dcf
commit 66439018fb
9 changed files with 150 additions and 67 deletions

View file

@ -33,12 +33,14 @@ class AudiobookChapterProgressBar extends HookConsumerWidget {
? null
: (player.bufferedPositionInBook - currentChapter.start);
final progress =
currentChapterProgress ?? position.data ?? const Duration(seconds: 0);
final total = currentChapter == null
? player.book?.duration ?? const Duration(seconds: 0)
: currentChapter.end - currentChapter.start;
return ProgressBar(
progress:
currentChapterProgress ?? position.data ?? const Duration(seconds: 0),
total: currentChapter == null
? player.book?.duration ?? const Duration(seconds: 0)
: currentChapter.end - currentChapter.start,
progress: progress,
total: total,
// ! TODO add onSeek
onSeek: (duration) {
player.seekInBook(