title: flutter - android back button does not call onWillPop of WillPopScope
body: <p>I would like to exit my application. I have implemented a WillPopScope, but it looks like the onWillPop function is not being called at all. I tried many things like swap WillPopScope with Scaffold, changing the return value of the function, but it just looks like it is not working as expected.</p>
  <p>My code:</p>
  <blockquote>
  <pre><code>Future&lt;bool&gt; _willPopCallback() async {
    exit(0);
    // await showDialog or Show add banners or whatever
    // then
    return true; // return true if the route to be popped
  }
  
  
  return Scaffold(
      appBar: MyAppBar(
        leading: DrawerAction(),
        title: Text(AppLocalizations.of(context).textCapitalized('home_page')),
        onSearch: (searchTerms) =&gt; this.search(searchTerms, context),
      ),
      body: new WillPopScope(
        onWillPop: _willPopCallback, // Empty Function.
        child: //my screen widgets
  </code></pre>
  </blockquote>
  <p>I am not sure if this is a bug I should report to flutter or I am doing something wrong. Happy to provide more code on request.</p>
  <p>I have tried:</p>
  <pre><code>exit(0);
  Navigator.of(context).pop();
  SystemChannels.platform.invokeMethod('SystemNavigator.pop');
  </code></pre>
  <p>Thanks in advance!</p>