How to detect it is a base route using Navigator API? The idea is to show a snackbar with a message when that happens.
For example, when user returned to the base route then if back button will be pressed one more time then the app is closed and notifying the user about it is useful.
You can use
WillPopScope. Where you can control back button click