mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-29 13:50:21 +08:00
refactor progress bar
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -27,24 +27,22 @@ class BottomControl extends StatelessWidget {
|
||||
|
||||
void onDragStart(ThumbDragDetails duration) {
|
||||
feedBack();
|
||||
controller.onChangedSliderStart(duration.timeStamp);
|
||||
controller
|
||||
..position.value = duration.seconds
|
||||
..isSeeking.value = true;
|
||||
}
|
||||
|
||||
void onDragUpdate(ThumbDragDetails duration) {
|
||||
if (!controller.isFileSource && controller.showSeekPreview) {
|
||||
controller.updatePreviewIndex(duration.timeStamp.inSeconds);
|
||||
controller.updatePreviewIndex(duration.seconds);
|
||||
}
|
||||
controller.onUpdatedSliderProgress(duration.timeStamp);
|
||||
controller.position.value = duration.seconds;
|
||||
}
|
||||
|
||||
void onSeek(Duration duration) {
|
||||
if (controller.showSeekPreview) {
|
||||
controller.showPreview.value = false;
|
||||
}
|
||||
void onSeek(int milliseconds) {
|
||||
controller
|
||||
..onChangedSliderEnd()
|
||||
..onChangedSlider(duration.inSeconds)
|
||||
..seekTo(Duration(seconds: duration.inSeconds), isSeek: false);
|
||||
..onSeekEnd()
|
||||
..seekTo(Duration(milliseconds: milliseconds), isSeek: false);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -70,15 +68,11 @@ class BottomControl extends StatelessWidget {
|
||||
clipBehavior: Clip.none,
|
||||
alignment: Alignment.bottomCenter,
|
||||
children: [
|
||||
Obx(() {
|
||||
final int value = controller.sliderPositionSeconds.value;
|
||||
final int max = controller.duration.value.inSeconds;
|
||||
return ProgressBar(
|
||||
progress: Duration(seconds: value),
|
||||
buffered: Duration(
|
||||
seconds: controller.bufferedSeconds.value,
|
||||
),
|
||||
total: Duration(seconds: max),
|
||||
Obx(
|
||||
() => ProgressBar(
|
||||
progress: controller.position.value,
|
||||
buffered: controller.buffered.value,
|
||||
total: controller.duration.value,
|
||||
progressBarColor: primary,
|
||||
baseBarColor: const Color(0x33FFFFFF),
|
||||
bufferedBarColor: bufferedBarColor,
|
||||
@@ -90,8 +84,8 @@ class BottomControl extends StatelessWidget {
|
||||
onDragStart: onDragStart,
|
||||
onDragUpdate: onDragUpdate,
|
||||
onSeek: onSeek,
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
if (controller.enableBlock &&
|
||||
videoDetailController.segmentProgressList.isNotEmpty)
|
||||
Positioned(
|
||||
|
||||
Reference in New Issue
Block a user