-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix: Progress bar does not follow drag #789 #798
Fix: Progress bar does not follow drag #789 #798
Conversation
There's one lint issue that needs to be addressed. Otherwise, LGTM. |
That is not related to the changes in this pull request. It appears that there is a lint issue in the code of the master branch. |
Still though. Since I have release authority on this repo, I need to be able to have everything green prior to delaying it to pub.dev. Once your changes are merged (along with the lint issue), then every other PR will have to re-sync to that lint fix. |
lib/src/progress_bar.dart
Outdated
Duration videoDuration, | ||
Offset? globalPosition, | ||
) { | ||
if (globalPosition == null) return Duration.zero; | ||
if (globalPosition == null) return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're already using Duration.zero
as a default value when calling this method, wouldn't it make sense to keep this line instead of returning null
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is also used here, and this property must distinguish between Duration.zero
(pointer dragged to the left edge) and null
(not dragged).
chewie/lib/src/progress_bar.dart
Line 210 in d1a99e1
final double playedPartPercent = (draggableValue != null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can add comments based on the above in the code, so that a reader of this line would understand why it needs to return null
, that would be very great. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
This PR fixes issue #789 and the following bugs that were uncovered as a result of fixing it: