Hint 1: Hide back arrow and use close button
How to hide the back arrow in the Flutter application bar and use the close button?
This simple code removes the “back” arrow (left side of the AppBar) and sets a “close” button (right side of the AppBar).
This line makes the trick to hide the “back” arrow. In fact, we override the default content of “leading” (what is at the left side of the title) by an empty container.
We create an IconButton, with as an icon the “X” (close).
onPressed(): when the user clicks this icon, we “pop” (remove) the current page.