Sometimes we may have as a root screen on Flutter a screen that is "closeable" - eg. when we launch a Flutter flow from a Native screen, the root screen on Flutter will usually be something the has a close or back to return back to the previous screen as the behaviour is much more of a "push" than a "replace". In these scenarios, trying to call a Nuvigator.pop() on this screen will fail as it's not poppable. At the same time, even when launching a full Flutter app, the root screen is something that might have a close button or behaviour and the pop() will also not work. But this is a behaviour that should by default happen as pressing the physical back button will pop this activity anyway.
So, this commit implements this behavior on the pop() method: if trying to call pop() on the rootNavigator when the stack is empty it'll perform a SystemNavigator.pop() and kill the screen.
Sometimes we may have as a root screen on Flutter a screen that is "closeable" - eg. when we launch a Flutter flow from a Native screen, the root screen on Flutter will usually be something the has a close or back to return back to the previous screen as the behaviour is much more of a "push" than a "replace". In these scenarios, trying to call a Nuvigator.pop() on this screen will fail as it's not poppable. At the same time, even when launching a full Flutter app, the root screen is something that might have a close button or behaviour and the pop() will also not work. But this is a behaviour that should by default happen as pressing the physical back button will pop this activity anyway. So, this commit implements this behavior on the pop() method: if trying to call pop() on the rootNavigator when the stack is empty it'll perform a SystemNavigator.pop() and kill the screen.