mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-02-17 06:49:34 +00:00
chore: 优化进度条显示
This commit is contained in:
parent
03cec3f4b6
commit
d96995a863
27 changed files with 1229 additions and 1311 deletions
|
|
@ -73,6 +73,7 @@ class PlayerSkipChapterStartEnd extends HookConsumerWidget {
|
|||
bookSettings.copyWith
|
||||
.playerSettings(skipChapterStart: interval),
|
||||
);
|
||||
reloadPlayer(ref);
|
||||
},
|
||||
),
|
||||
),
|
||||
|
|
@ -97,6 +98,7 @@ class PlayerSkipChapterStartEnd extends HookConsumerWidget {
|
|||
bookSettings.copyWith
|
||||
.playerSettings(skipChapterEnd: interval),
|
||||
);
|
||||
reloadPlayer(ref);
|
||||
},
|
||||
),
|
||||
),
|
||||
|
|
@ -104,4 +106,15 @@ class PlayerSkipChapterStartEnd extends HookConsumerWidget {
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
void reloadPlayer(WidgetRef ref) {
|
||||
final currentBook = ref.watch(currentBookProvider);
|
||||
if (currentBook == null) {
|
||||
return;
|
||||
}
|
||||
final absPlayer = ref.read(absPlayerProvider);
|
||||
final positionInBook = absPlayer.positionInBook;
|
||||
ref.read(currentBookProvider.notifier).update(currentBook.libraryItemId,
|
||||
force: true, currentTime: positionInBook);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue