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
Comments
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? |
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. |
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. |
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: 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 |
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? |
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.
The text was updated successfully, but these errors were encountered: