refa: video progress indicator

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-01-18 22:21:48 +08:00
parent f5657d2d4c
commit 395893fc7d
7 changed files with 193 additions and 35 deletions

View File

@@ -224,8 +224,11 @@ class DetailItem extends StatelessWidget {
child: Stack(
clipBehavior: Clip.none,
children: [
videoProgressIndicator(
progress / entry.totalTimeMilli,
VideoProgressIndicator(
color: theme.colorScheme.primary,
backgroundColor:
theme.colorScheme.secondaryContainer,
progress: progress / entry.totalTimeMilli,
),
PBadge(
text: progress >= entry.totalTimeMilli - 400

View File

@@ -157,8 +157,11 @@ class HistoryItem extends StatelessWidget {
left: 0,
right: 0,
bottom: 0,
child: videoProgressIndicator(
item.progress == -1
child: VideoProgressIndicator(
color: theme.colorScheme.primary,
backgroundColor:
theme.colorScheme.secondaryContainer,
progress: item.progress == -1
? 1
: item.progress! / item.duration!,
),

View File

@@ -136,8 +136,11 @@ class VideoCardHLater extends StatelessWidget {
left: 0,
bottom: 0,
right: 0,
child: videoProgressIndicator(
progress == -1
child: VideoProgressIndicator(
color: theme.colorScheme.primary,
backgroundColor:
theme.colorScheme.secondaryContainer,
progress: progress == -1
? 1
: progress / videoItem.duration!,
),

View File

@@ -141,8 +141,16 @@ class VideoCardHMemberVideo extends StatelessWidget {
left: 0,
right: 0,
bottom: 0,
child: videoProgressIndicator(
videoItem.history!.progress! /
child: VideoProgressIndicator(
color:
theme.colorScheme.primary,
backgroundColor: theme
.colorScheme
.secondaryContainer,
progress:
videoItem
.history!
.progress! /
videoItem
.history!
.duration!,