Flutter: Move to a new screen without back : <p>I'm implementing an authentication flow in my Flutter app.</p>

<p>After a sign in attempt, the CheckAuth <em>(which checks whether a user is signed in or not and then opens home screen or sign up screen accordingly)</em> is opened with this code: </p>

<pre><code>  void _signIn() async {
    await _auth
        .signInWithEmailAndPassword(
            email: _userEmail.trim(), password: _userPassword.trim())
        .then((task) {
      // go to home screen
      if (task.getIdToken() != null) {
        setState(() {
          Navigator.pushReplacement(
              context,
              new MaterialPageRoute(
                  builder: (BuildContext context) =&gt; new CheckAuth()));
        });
      } else {
        print("Authentication failed");
      }
    });
  }
</code></pre>

<p>Problem: I can successfully sign in to the app, but if I tap back button after I sign in, it goes back to the sign in screen (while I expect it to exit from the app).</p>

<p>Question: <strong>How to move from one screen to another in Flutter without the way back?</strong> </p>

<p>Do I need to somehow delete the navigator history? Or don't use navigator at all? I tried <em>Navigator.replace</em> method, but it didn't seem to work.</p>
