hcbpassos / double_back_to_close_app

A Flutter package that allows Android users to press the back-button twice to close the app.
BSD 2-Clause "Simplified" License
59 stars 17 forks source link

Whenever I tap back button once, sanckbar appear #7

Closed byeonghwa-jeong closed 2 years ago

byeonghwa-jeong commented 4 years ago

Hello, thank you for your plugin

I am trying to make a function to exit app when double tab the back button in the CupertinoTabbar.

However, whenever I tap the back button, an exit message appeared.

Hence I want to build a code work like following:

Is it possible to solve these problems using this plugin?

I have also asked in the stackoverflow. Address of it is that:

https://stackoverflow.com/questions/60587411/how-can-i-separate-one-tap-and-double-tap-of-back-button-in-flutter

Thank you!

ghost commented 4 years ago

This package should got you covered, as long as you handle the initial situation you mentioned:

just tap back button once, return before pages

I can help you find out what exactly is not working, but I need a small reproducible snippet. Note: The Stack Overflow snippet is not reproducible, since it depends on FirebaseUser.

mdanialr commented 3 years ago

@joun2001 actually, what back button do is pop one layer/page from your stacks, its exactly like Navigator.pop(context). It's mean that 'this' layer will be poped up from the stack. If your current layer/page is the last layer in the stack, then it will close your app.

hcbpassos commented 2 years ago

i'm closing this due to lack of activity.