I love this Twitter thread by Mike Rydstrom, where he describes the various back button behaviors he's seen in Android apps with a bottom navigation bar or a top tab view.
I have to confess that this isn't something I've given a huge amount of thought to in my own Flutter apps. I've mostly just relied on the default behavior, which pops back to the previous page -- or exits the app if there isn't a previous page to return to in the current navigation stack.
As Mike points out (correctly I believe), this really isn't optimal behavior. Read his thread to find out why, and what you might try instead.