Skip to content
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

Add callback to report on drag progress #10

Closed
cachapa opened this issue Feb 22, 2022 · 6 comments
Closed

Add callback to report on drag progress #10

cachapa opened this issue Feb 22, 2022 · 6 comments

Comments

@cachapa
Copy link

cachapa commented Feb 22, 2022

We're trying to fade out the page background (which is separate from the DismissiblePage widget) when the user starts dragging, but unfortunately there's no way to get the drag progress.

It would be nice if the drag progress could be reported via a callback, ideally with a value of 0.0-1.0, indicating how much the dismissible has been dragged compared to its total width/height.

@Tkko
Copy link
Owner

Tkko commented Mar 1, 2022

Sure, will do.

@aytunch
Copy link

aytunch commented Mar 1, 2022

Maybe exposing the Rect can be more useful than a double value for other use cases as well.

@Tkko
Copy link
Owner

Tkko commented Mar 2, 2022

Maybe exposing the Rect can be more useful than a double value for other use cases as well.

Could you elaborate more why Rect will be more useful? Any use case example.

@Tkko Tkko closed this as completed Mar 2, 2022
@Tkko Tkko reopened this Mar 2, 2022
@aytunch
Copy link

aytunch commented Mar 2, 2022

@Tkko The current screen being dismissed can be dismissed from all directions with your new addition to the package, thanks btw (towards bottom, left, right, top).
Also the screen can get smaller while being dismissed.
If we expose the dismissing screen's Rect, the first advantage that comes to my mind is we can know if the screen is being dismissed vertically or horizontally.
With just a double between 0 and 1, let's say 0.5, we don't know if the screen's bottom or left half is being shown.
I am positive that having more info coming from your API will be useful for us users in the long run.
We can have a simple getter which gives the double value calculated easily from the visible Rect too..

@Tkko
Copy link
Owner

Tkko commented Mar 2, 2022

Convinced, Thanks.

@Tkko
Copy link
Owner

Tkko commented Jun 30, 2022

Hey guys, long time no see, check out the new version 0.7.3 onDragUpdate outputs DismissiblePageDragUpdateDetails

  final double overallDragValue;
  final double radius;
  final double opacity;
  final double scale;
  final Offset offset;

@Tkko Tkko closed this as completed Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants