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

innerDrawerCallback parameter -> which side #56

Open
noobloser opened this issue Dec 5, 2020 · 3 comments
Open

innerDrawerCallback parameter -> which side #56

noobloser opened this issue Dec 5, 2020 · 3 comments

Comments

@noobloser
Copy link

The passing value for innerDrawerCallBack does not define rn which side of the drawer is opened.
It would be great to get ahold of this information somehow.
(I saw one issue here, where someone requested the extension of the GlobalKey to not only change the state, but also get the value, which sounds nice imo :D)

@EbramTawfik
Copy link

EbramTawfik commented Jan 14, 2021

@noobloser did you find a workaround to find which side called the callback?
I found workaround:
1- onDragUpdate will set which direction.
2- innerDrawerCallback will set open or close

      onDragUpdate: (value, direction) {
        _direction = direction;
      },
      innerDrawerCallback: (isOpen) {
        if (onChange != null) {
          onChange(isOpen, _direction);
        }
      },

@noobloser
Copy link
Author

@EbramTawfik I did not work on it any further till now, as my application has more major problems rn :/

Also if I remember that correctly, I used onDragUpdate before, but it fires based on the swipe direction, so it does not fire, when I use my own button to open the drawer. (correct me if I'm wrong)

But based on your approach, I could set the _direction in onDragUpdate, as well as in the buttons onPressed Callback, which would be a working approach (even though it is kind of hacky)

@EbramTawfik
Copy link

@noobloser it fires on both swipe and toggle from the button. But I will try again to confirm.

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

2 participants