mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-02-17 23:09:36 +00:00
播放界面增加一个总进度条,mini播放器改为单章节进度
This commit is contained in:
parent
63a12f96e4
commit
94f1376572
3 changed files with 62 additions and 38 deletions
|
|
@ -34,8 +34,9 @@ class PlayerWhenMinimized extends HookConsumerWidget {
|
|||
final currentChapter = ref.watch(currentPlayingChapterProvider);
|
||||
|
||||
final vanishingPercentage = 1 - percentageMiniplayer;
|
||||
final progress =
|
||||
useStream(player.slowPositionStreamInBook, initialData: Duration.zero);
|
||||
// final progress =
|
||||
// useStream(player.slowPositionStreamInBook, initialData: Duration.zero);
|
||||
final progress = useStream(player.positionStream, initialData: Duration.zero);
|
||||
|
||||
final bookMetaExpanded = ref.watch(currentBookMetadataProvider);
|
||||
|
||||
|
|
@ -57,8 +58,7 @@ class PlayerWhenMinimized extends HookConsumerWidget {
|
|||
context.pushNamed(
|
||||
Routes.libraryItem.name,
|
||||
pathParameters: {
|
||||
Routes.libraryItem.pathParamName!:
|
||||
player.book!.libraryItemId,
|
||||
Routes.libraryItem.pathParamName!: player.book!.libraryItemId,
|
||||
},
|
||||
);
|
||||
},
|
||||
|
|
@ -92,10 +92,7 @@ class PlayerWhenMinimized extends HookConsumerWidget {
|
|||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurface
|
||||
.withValues(alpha: 0.7),
|
||||
color: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.7),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
@ -139,8 +136,9 @@ class PlayerWhenMinimized extends HookConsumerWidget {
|
|||
SizedBox(
|
||||
height: barHeight,
|
||||
child: LinearProgressIndicator(
|
||||
value: (progress.data ?? Duration.zero).inSeconds /
|
||||
player.book!.duration.inSeconds,
|
||||
// value: (progress.data ?? Duration.zero).inSeconds /
|
||||
// player.book!.duration.inSeconds,
|
||||
value: (progress.data ?? Duration.zero).inSeconds / player.duration!.inSeconds,
|
||||
color: Theme.of(context).colorScheme.onPrimaryContainer,
|
||||
backgroundColor: Theme.of(context).colorScheme.primaryContainer,
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue