title: Back button Flutter on a return Scaffold
body: <p>I'm new to Flutter, so I apologize if the question is very basic.</p>
  <p>My problem is with the back button... when I press it it sends me to a black page, but when I press the android back button it works fine. Is there a way to make that button the same as the one on the device?</p>
  <p>In Android that button is not necessary, but in iOS it is.</p>
  <p>My code is:</p>
  <pre><code>class FindDevicesScreen extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      bool scanResult = false;
      bool connectedResult = false;
      return Scaffold(
        appBar: AppBar(
          leading: IconButton(
            icon: Icon(Icons.arrow_back),
            onPressed: () =&gt; Navigator.pop(context, false),
          ),
          title: Text('Find Devices'),
          actions: &lt;Widget&gt;[],
        ),
  </code></pre>
  <p><a href="https://pub.dev/packages/flutter_blue/example" rel="nofollow noreferrer">https://pub.dev/packages/flutter_blue/example</a>
  (The example code doesn't have that function)</p>
  <p>I tried with:</p>
  <pre><code>onPressed: () =&gt; Navigator.pop(context, false),
  
  onPressed: () { Navigator.pop(context); },
  </code></pre>
  <p>But it does not work. It doesn't go back to the previous page, but to a black page with nothing.</p>