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

Possible solution with cupertinotabbar #21

Open
eripe970 opened this issue Feb 23, 2022 · 5 comments
Open

Possible solution with cupertinotabbar #21

eripe970 opened this issue Feb 23, 2022 · 5 comments

Comments

@eripe970
Copy link

Hey,

I'm using a CupertinoTabScaffold with 4 tabs and I've been trying to get this functionality to work with that. Any idea on how to support this feature? The problem I'm having is that the snackbar message is shown on all of the tabs that I have and the users can't exit the app because of that.

@hcbpassos
Copy link
Owner

i'm not sure i understand the expected behavior. do you want the back button to switch between the tabs instead of closing the app?

@eripe970
Copy link
Author

eripe970 commented Mar 3, 2022

I want the back-button to close the app.

The problem is that the snackbar is displayed on all tabs, it doesn't take into consideration which tab is active.

@hcbpassos
Copy link
Owner

if only one tab can be active at a time, why should we check which one is active?

i believe i may be either not understanding your problem or this is a xy problem. would you mind sharing a minimal reproducible example of the issue you are facing? maybe it can help to clarify your point.

@zachatrocity
Copy link

The issue is that you should be able to default the user back to the home tab before the snackbar is triggered. For example,

If I'm on the person tab here:

image

and I press 'back' i should should be able to first navigate the user to the home tab before triggering the DoubleBackToCloseApp functionality.

I've had to use https://api.flutter.dev/flutter/widgets/WillPopScope-class.html in order to implement this and I can't use this library

@hcbpassos
Copy link
Owner

thanks for clarifying the issue :)

this library checks the local history in order to determine whether it should show the snackbar. there are a few tests that check the behavior you mentioned, but using a drawer instead of tabs.

i believe that WillPopScope adds an entry to the local history, so i am not 100% sure the issue is in this library. would you share a reproducible example of such an issue so i can validate that?

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