-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thumb initial position is always zero #12
Comments
Could you give a code example that shows the error? (preferably as an in-answer code block or a link to a GitHub repo rather and a zip file) I'm not sure I really understand. The isDraggable option sounds like a different issue. Could you open another issue for that one and explain your use case? |
I think the bug that he is trying to show is the one on this video. video_bug.mp4To replicate it you just need to add the seekbar inside a
|
So the effect that is trying to be achieved is fade in and fade out for the progress bar, correct? I'm able to achieve that effect with StreamBuilder<DurationState> _progressBar() {
return StreamBuilder<DurationState>(
stream: _durationState,
builder: (context, snapshot) {
final durationState = snapshot.data;
final progress = durationState?.progress ?? Duration.zero;
final buffered = durationState?.buffered ?? Duration.zero;
final total = durationState?.total ?? Duration.zero;
return AnimatedOpacity(
opacity: _visibility,
duration: const Duration(milliseconds: 300),
child: ProgressBar(
progress: progress,
buffered: buffered,
total: total,
onSeek: (duration) {
_player.seek(duration);
},
timeLabelLocation: _labelLocation,
timeLabelType: _labelType,
timeLabelTextStyle: _labelStyle,
),
);
},
);
} This is from a modified version of the example project. Here is what it looks like: I don't get the thumb jumping to zero. Theoretically the thumb is just a ratio of the progress to the total time. It should only be zero if the progress or the total time is zero. That might indicate an error with these values. |
If you add |
I added logger for
edit: this is what I got before
|
I managed to workaround this ussue by using following method instead of Visibility widget
|
Several people have mentioned the problem when using the |
I suppose this is because thumb widget doesn't depend on progress value. You can remember state for |
@enseitankad0 Thanks for your comment. That put me on the right track to solving the problem. I looked more into the That explanation aside, I updated I've published the change as version If anyone can confirm that it works I'll close this issue. |
I'll close this issue for now but I can reopen it if there are any more problems related to it. |
By default, the progress bar thumb is on position zero despite the fact that the progress value is set to different value. I tried to resolve this issue and I think this is because the
double _thumbValue = 0.0
. It should be given a value in constructor. I tried to fix this and came with this solution:audio_video_progress_bar.zip
P. S. I also implemented an isDraggable named parameter, in order to restrict the possibility to move the thumb if needed.
The text was updated successfully, but these errors were encountered: