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 for on modal dismiss with drag to be utilized in Navigator 2.0 #15

Merged
merged 1 commit into from
Jul 17, 2023

Conversation

ulusoyca
Copy link
Collaborator

@ulusoyca ulusoyca commented Jul 16, 2023

This PR adds onModalDismissedWithDrag field to the WoltModalSheetRoute to detect the modal dismiss with drag gesture.

When using imperative API, it is enough to call Navigator.of(context).pop() to dismiss the modal. In fact, this is the default behavior when dismiss callbacks are not provided by the library users. However, using Navigator 2.0 requires actions in the callbacks to update the app state that builds the navigation stack on modal dismiss events.

In this screen recording from navigator2 playground example, it can be seen that the address bar is updated with both barrier tap and dismiss by frag events.

Note that earlier, this was handled in router delegate with Navigator's onPop callback. We no longer need to handle this imperatively in the Navigator widget.

on_dismissed_with_drag.mov

Copy link
Collaborator

@MuTe33 MuTe33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, like it! 🚢

@ulusoyca ulusoyca merged commit b43df68 into main Jul 17, 2023
@alirp88 alirp88 deleted the add-callback-for-modal-dismiss-with-gesture branch January 19, 2024 10:40
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

Successfully merging this pull request may close these issues.

2 participants