How I can show back button when device is iPhone

2.8k Views Asked by At

I am developing an app using flutter. But I am stuck on a situation that Android device has its default back button but iPhone don't. So I need to show back button when I open app in iOS device. Also if there is any other built in functionality available please guide me.

2

There are 2 best solutions below

0
On

Use a Scaffold with AppBar, it automatically creates the virtual back button at the top-right of the screen. (Assuming you push the Widget from another screen).

     return Scaffold(
            appBar: AppBar(
              title: Text("Title"),
            ),
            body: YourBody(),

            );
2
On

By default, we will get the backButton for both the android and iOS. If we don't want it, we can remove by giving empty container(Container()) to the leading value to the appBar. Refer this for more details