3

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.

Code Hunter
  • 10,075
  • 23
  • 72
  • 102
  • if you're not using material and you're building your own custom interface, you'll need 'dart:io' [Platform.isIOS](https://docs.flutter.io/flutter/dart-io/Platform/isIOS.html) to detect iOS... – Feu Sep 21 '18 at 03:44

2 Answers2

0

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

Dinesh Balasubramanian
  • 20,532
  • 7
  • 64
  • 57
0

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(),

            );
diegoveloper
  • 93,875
  • 20
  • 236
  • 194