Skip to content

Commit

Permalink
remove need for stateful _thumbValue (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
suragch committed Jul 30, 2021
1 parent 49ef08c commit 89cb47d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.6.2] - July 30, 2021

* Initialize the thumb position based on progress and total time. This allows compatibily with the `Visibility` even when not maintaining state. (#12)

## [0.6.1] - July 23, 2021

* Added `timeLabelPadding` parameter for putting some extra space between the time labels and progress bar.
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.6.1"
version: "0.6.2"
boolean_selector:
dependency: transitive
description:
Expand Down
3 changes: 2 additions & 1 deletion lib/audio_video_progress_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,15 @@ class _RenderProgressBar extends RenderBox {
..onUpdate = _onDragUpdate
..onEnd = _onDragEnd
..onCancel = _finishDrag;
_thumbValue = _proportionOfTotal(_progress);
}

// This is the gesture recognizer used to move the thumb.
HorizontalDragGestureRecognizer? _drag;

// This is a value between 0.0 and 1.0 used to indicate the position on
// the bar.
double _thumbValue = 0.0;
late double _thumbValue;

// The thumb can move for two reasons. One is that the [progress] changed.
// The other is that the user is dragging the thumb. This variable keeps
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: audio_video_progress_bar
description: A progress bar widget to show or change the position of an audio or
video stream.
version: 0.6.1
version: 0.6.2
homepage: https://github.com/suragch/audio_video_progress_bar

environment:
Expand Down

0 comments on commit 89cb47d

Please sign in to comment.