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
Report progress on Dismissible update callback #95504
Conversation
| @@ -12,6 +12,7 @@ const DismissDirection defaultDismissDirection = DismissDirection.horizontal; | |||
| const double crossAxisEndOffset = 0.5; | |||
| bool reportedDismissUpdateReached = false; | |||
| bool reportedDismissUpdatePreviousReached = false; | |||
| double reportedDismissUpdateProgress = 0.0; | |||
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.
Can you add tests for non-zero cases?
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.
I went back to check and it turns out I forgot to update the value using the callback.
It's fixed now, I'll commit shortly.
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.
Can you add another test that validates it reports the right value somewhere in between 0 and 1? 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.
Done.
| @@ -12,6 +12,7 @@ const DismissDirection defaultDismissDirection = DismissDirection.horizontal; | |||
| const double crossAxisEndOffset = 0.5; | |||
| bool reportedDismissUpdateReached = false; | |||
| bool reportedDismissUpdatePreviousReached = false; | |||
| double reportedDismissUpdateProgress = 0.0; | |||
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.
Can you add another test that validates it reports the right value somewhere in between 0 and 1? Thanks!
This LGTM! Thank you for the contribution!
I've reached out to the team for a secondary review.
|
Thanks. I'm sorry it took so long, I didn't notice that the tests were failing since last week. |
|
I'm kind of new to this, is there anything else required from my side? |
|
Nope sorry, we just didn't notice it was ready to land! My bad! |
This PR adds a
progressparameter to the DismissibleonUpdatecallback.The value represents how far the dismissible child has been dragged in its parent container as a ratio value between 0.0 and 1.0, which can be useful to e.g. fade elements in sync with the gesture.
This implementation also correctly reports the position during the return animation when the dismiss is unsuccessful.
This PR partly solves #21230 (3rd. point) and closes #74582
Pre-launch Checklist
///).The text was updated successfully, but these errors were encountered: