Report progress on Dismissible update callback#95504
Report progress on Dismissible update callback#95504fluttergithubbot merged 7 commits intoflutter:masterfrom cachapa:dismissible_progress
Conversation
| const double crossAxisEndOffset = 0.5; | ||
| bool reportedDismissUpdateReached = false; | ||
| bool reportedDismissUpdatePreviousReached = false; | ||
| double reportedDismissUpdateProgress = 0.0; |
There was a problem hiding this comment.
Can you add tests for non-zero cases?
There was a problem hiding this comment.
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.
Can you add another test that validates it reports the right value somewhere in between 0 and 1? Thanks!
| const double crossAxisEndOffset = 0.5; | ||
| bool reportedDismissUpdateReached = false; | ||
| bool reportedDismissUpdatePreviousReached = false; | ||
| double reportedDismissUpdateProgress = 0.0; |
There was a problem hiding this comment.
Can you add another test that validates it reports the right value somewhere in between 0 and 1? Thanks!
Piinks
left a comment
There was a problem hiding this comment.
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
///).