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 getter for atRoot #202

Closed
dickermoshe opened this issue May 9, 2024 · 4 comments · Fixed by #204 or #208
Closed

add getter for atRoot #202

dickermoshe opened this issue May 9, 2024 · 4 comments · Fixed by #204 or #208
Labels
enhancement New feature or request

Comments

@dickermoshe
Copy link
Contributor

What feature would you like to see?

The current implementation of WoltModalSheets navigator is really fantastic.
It would be even better if there was a way to access how many pages are in the stack.

This is relevant for making a dynamic back button for a page.
If we knew that we were at index 0, it would show a close button that closes the sheet, or a back button that navigates back.

_currentPageIndex is private now, it would be awesome if it wasn't.

@dickermoshe dickermoshe added the enhancement New feature or request label May 9, 2024
@ulusoyca
Copy link
Collaborator

@dickermoshe Thanks! Our conversation was really helpful. Would you consider opening a PR?

@dickermoshe
Copy link
Contributor Author

#204

@dickermoshe
Copy link
Contributor Author

My only complaint is that now WoltModalSheet... is polluted when looking for the show function.
image

Like, these aren't really that helpful, the code is basically the same.
image

Flutter uses .of for looking up controllers in context, that's what users are used to
I would've kept it all hidden behind .of()
image

This is just my humble opinion, otherwise the implementation is top notch

@ulusoyca
Copy link
Collaborator

Thank you for the feedback! Yes, makes sense. This PR removes the duplicate methods and sticks with WoltModalSheet.of(context).method type calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants