<h2 dir="auto">Steps to Reproduce</h2>
<p dir="auto">I have pages that when an action is taken it pushes a route to goto another page, I use the code below:</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Route route = new MaterialPageRoute(
        settings: new RouteSettings(name: &quot;/PostAuthHome&quot;),
        builder: (BuildContext context) =&gt; new PostAuthHome.PostAuthHome(title: &quot;LOOP Home&quot;),
      );
      Navigator.of(context).pushReplacement(route);"><pre class="notranslate"><span class="pl-c1">Route</span> route <span class="pl-k">=</span> <span class="pl-k">new</span> <span class="pl-c1">MaterialPageRoute</span>(
        settings<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">RouteSettings</span>(name<span class="pl-k">:</span> <span class="pl-s">"/PostAuthHome"</span>),
        builder<span class="pl-k">:</span> (<span class="pl-c1">BuildContext</span> context) <span class="pl-k">=&gt;</span> <span class="pl-k">new</span> <span class="pl-c1">PostAuthHome</span>.<span class="pl-c1">PostAuthHome</span>(title<span class="pl-k">:</span> <span class="pl-s">"LOOP Home"</span>),
      );
      <span class="pl-c1">Navigator</span>.<span class="pl-en">of</span>(context).<span class="pl-en">pushReplacement</span>(route);</pre></div>
<p dir="auto">When I do the Appbar has a back button and should not.</p>
<h2 dir="auto">Flutter Doctor</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[✓] Flutter (on Mac OS X 10.12.6 16G1036, locale en-US, channel master)
    • Flutter at /Users/dnetman99/flutter
    • Framework revision 0c09179b65 (10 days ago), 2017-12-09 22:04:06 -0800
    • Engine revision edb0201fa2
    • Tools Dart version 1.25.0-dev.11.0
    • Engine Dart version 2.0.0-edge.a38ac7cf127f4611c873c2f2d523c06ce06b1342

[✓] Android toolchain - develop for Android devices (Android SDK 26.0.2)
    • Android SDK at /Users/dnetman99/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-26, build-tools 26.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.2, Build version 9C40b
    • ios-deploy 1.9.2
    • CocoaPods version 1.2.1

[✓] Android Studio (version 3.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] IntelliJ IDEA Ultimate Edition (version 2017.2.5)
    • Flutter plugin version 18.4
    • Dart plugin version 172.4343.25

[✓] Connected devices
    • Android SDK built for x86 • emulator-5554                        • android-x86 • Android 7.1.1 (API 25) (emulator)
    • iPhone 8                  • 1D8F1697-B7FC-4319-B06F-C0C3A9C9A626 • ios         • iOS 11.2 (simulator)
"><pre class="notranslate"><code class="notranslate">[✓] Flutter (on Mac OS X 10.12.6 16G1036, locale en-US, channel master)
    • Flutter at /Users/dnetman99/flutter
    • Framework revision 0c09179b65 (10 days ago), 2017-12-09 22:04:06 -0800
    • Engine revision edb0201fa2
    • Tools Dart version 1.25.0-dev.11.0
    • Engine Dart version 2.0.0-edge.a38ac7cf127f4611c873c2f2d523c06ce06b1342

[✓] Android toolchain - develop for Android devices (Android SDK 26.0.2)
    • Android SDK at /Users/dnetman99/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-26, build-tools 26.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.2, Build version 9C40b
    • ios-deploy 1.9.2
    • CocoaPods version 1.2.1

[✓] Android Studio (version 3.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] IntelliJ IDEA Ultimate Edition (version 2017.2.5)
    • Flutter plugin version 18.4
    • Dart plugin version 172.4343.25

[✓] Connected devices
    • Android SDK built for x86 • emulator-5554                        • android-x86 • Android 7.1.1 (API 25) (emulator)
    • iPhone 8                  • 1D8F1697-B7FC-4319-B06F-C0C3A9C9A626 • ios         • iOS 11.2 (simulator)

</code></pre></div>
<blockquote>
<p dir="auto">For more information about diagnosing and reporting Flutter bugs, please see <a href="https://flutter.io/bug-reports/" rel="nofollow">https://flutter.io/bug-reports/</a>.</p>
</blockquote>
<h2 dir="auto">Steps to Reproduce</h2>
<ol dir="auto">
<li>
<p dir="auto">Found this issue when I was trying to navigate from a screen to another using the <code class="notranslate">Navigator.pushReplacement()</code> call, after clearing the Navigator route stack using <code class="notranslate">Navigator.pop().</code> To reproduce build a two screen app, where both of the screens use a <code class="notranslate">Scaffold</code> with an <code class="notranslate">AppBar</code>.</p>
</li>
<li>
<p dir="auto">In your app use</p>
</li>
</ol>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Navigator.popUntil(context, (_) =&gt; !Navigator.canPop(context));
Navigator.pushReplacement(
      context, new MaterialPageRoute(builder: (BuildContext context) =&gt; route));"><pre class="notranslate"><span class="pl-c1">Navigator</span>.<span class="pl-en">popUntil</span>(context, (_) <span class="pl-k">=&gt;</span> <span class="pl-k">!</span><span class="pl-c1">Navigator</span>.<span class="pl-en">canPop</span>(context));
<span class="pl-c1">Navigator</span>.<span class="pl-en">pushReplacement</span>(
      context, <span class="pl-k">new</span> <span class="pl-c1">MaterialPageRoute</span>(builder<span class="pl-k">:</span> (<span class="pl-c1">BuildContext</span> context) <span class="pl-k">=&gt;</span> route));</pre></div>
<p dir="auto">to navigate from one screen to the other.</p>
<ol start="3" dir="auto">
<li>The observation is that the app bar shows a back button momentarily, after the route navigation is triggered. The back button disappears in a fraction of a second. No errors are thrown in the log messages.</li>
</ol>
<p dir="auto">Here is my sample app, that can be used to reproduce this issue.</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import 'package:flutter/material.dart';
import 'package:meta/meta.dart';

void main() {
  runApp(new MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Wifi App',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new AppScaffold(isWifiOn: true),
    );
  }
}

class AppScaffold extends StatelessWidget {
  static final String wifiOnAppBarTitle = &quot;Wifi is On&quot;;
  static final String wifiOffAppBarTitle = &quot;Wifi is Off&quot;;

  // Is wifi on, at present
  final bool isWifiOn;
  AppScaffold({@required this.isWifiOn});

  Widget body(BuildContext context) {
    return new Center(
        child: new GestureDetector(
      child: isWifiOn ? new Icon(Icons.wifi) : new Icon(Icons.wifi_off),
      onTap: () {
        if (isWifiOn) {
          clearStackAndPushRoute(context, new AppScaffold(isWifiOn: false));
        } else {
          clearStackAndPushRoute(context, new AppScaffold(isWifiOn: true));
        }
      },
    ));
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
          title: isWifiOn
              ? new Text(wifiOnAppBarTitle)
              : new Text(wifiOffAppBarTitle)),
      body: body(context),
    );
  }
}

void clearStackAndPushRoute(BuildContext context, Widget route) {
  Navigator.popUntil(context, (_) =&gt; !Navigator.canPop(context));
  Navigator.pushReplacement(
      context, new MaterialPageRoute(builder: (BuildContext context) =&gt; route));
}"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s">'package:flutter/material.dart'</span>;
<span class="pl-k">import</span> <span class="pl-s">'package:meta/meta.dart'</span>;

<span class="pl-k">void</span> <span class="pl-en">main</span>() {
  <span class="pl-en">runApp</span>(<span class="pl-k">new</span> <span class="pl-c1">MyApp</span>());
}

<span class="pl-k">class</span> <span class="pl-c1">MyApp</span> <span class="pl-k">extends</span> <span class="pl-c1">StatelessWidget</span> {
  <span class="pl-c">// This widget is the root of your application.</span>
  <span class="pl-k">@override</span>
  <span class="pl-c1">Widget</span> <span class="pl-en">build</span>(<span class="pl-c1">BuildContext</span> context) {
    <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-c1">MaterialApp</span>(
      title<span class="pl-k">:</span> <span class="pl-s">'Wifi App'</span>,
      theme<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">ThemeData</span>(
        primarySwatch<span class="pl-k">:</span> <span class="pl-c1">Colors</span>.blue,
      ),
      home<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">AppScaffold</span>(isWifiOn<span class="pl-k">:</span> <span class="pl-c1">true</span>),
    );
  }
}

<span class="pl-k">class</span> <span class="pl-c1">AppScaffold</span> <span class="pl-k">extends</span> <span class="pl-c1">StatelessWidget</span> {
  <span class="pl-k">static</span> <span class="pl-k">final</span> <span class="pl-c1">String</span> wifiOnAppBarTitle <span class="pl-k">=</span> <span class="pl-s">"Wifi is On"</span>;
  <span class="pl-k">static</span> <span class="pl-k">final</span> <span class="pl-c1">String</span> wifiOffAppBarTitle <span class="pl-k">=</span> <span class="pl-s">"Wifi is Off"</span>;

  <span class="pl-c">// Is wifi on, at present</span>
  <span class="pl-k">final</span> <span class="pl-c1">bool</span> isWifiOn;
  <span class="pl-c1">AppScaffold</span>({<span class="pl-k">@required</span> <span class="pl-c1">this</span>.isWifiOn});

  <span class="pl-c1">Widget</span> <span class="pl-en">body</span>(<span class="pl-c1">BuildContext</span> context) {
    <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-c1">Center</span>(
        child<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">GestureDetector</span>(
      child<span class="pl-k">:</span> isWifiOn <span class="pl-k">?</span> <span class="pl-k">new</span> <span class="pl-c1">Icon</span>(<span class="pl-c1">Icons</span>.wifi) <span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Icon</span>(<span class="pl-c1">Icons</span>.wifi_off),
      onTap<span class="pl-k">:</span> () {
        <span class="pl-k">if</span> (isWifiOn) {
          <span class="pl-en">clearStackAndPushRoute</span>(context, <span class="pl-k">new</span> <span class="pl-c1">AppScaffold</span>(isWifiOn<span class="pl-k">:</span> <span class="pl-c1">false</span>));
        } <span class="pl-k">else</span> {
          <span class="pl-en">clearStackAndPushRoute</span>(context, <span class="pl-k">new</span> <span class="pl-c1">AppScaffold</span>(isWifiOn<span class="pl-k">:</span> <span class="pl-c1">true</span>));
        }
      },
    ));
  }

  <span class="pl-k">@override</span>
  <span class="pl-c1">Widget</span> <span class="pl-en">build</span>(<span class="pl-c1">BuildContext</span> context) {
    <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-c1">Scaffold</span>(
      appBar<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">AppBar</span>(
          title<span class="pl-k">:</span> isWifiOn
              <span class="pl-k">?</span> <span class="pl-k">new</span> <span class="pl-c1">Text</span>(wifiOnAppBarTitle)
              <span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Text</span>(wifiOffAppBarTitle)),
      body<span class="pl-k">:</span> <span class="pl-en">body</span>(context),
    );
  }
}

<span class="pl-k">void</span> <span class="pl-en">clearStackAndPushRoute</span>(<span class="pl-c1">BuildContext</span> context, <span class="pl-c1">Widget</span> route) {
  <span class="pl-c1">Navigator</span>.<span class="pl-en">popUntil</span>(context, (_) <span class="pl-k">=&gt;</span> <span class="pl-k">!</span><span class="pl-c1">Navigator</span>.<span class="pl-en">canPop</span>(context));
  <span class="pl-c1">Navigator</span>.<span class="pl-en">pushReplacement</span>(
      context, <span class="pl-k">new</span> <span class="pl-c1">MaterialPageRoute</span>(builder<span class="pl-k">:</span> (<span class="pl-c1">BuildContext</span> context) <span class="pl-k">=&gt;</span> route));
}</pre></div>
<h2 dir="auto">Logs</h2>
<p dir="auto">No exceptions thrown</p>
<h2 dir="auto">Flutter Doctor</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[-] Flutter (on Linux, locale en_US.UTF-8, channel google3)
    • Flutter at /google/obj/workspace/d9981df61cffad7a0e5a854147e02734/ee049f8d-e0ae-4e42-ba92-614f4524525c/blaze-out/k8-opt/bin/mobile/flutter/tools/tools.runfiles/google3
    • Framework revision null (null), null
    • Engine revision null
    • Tools Dart version null
    ✗ Downloaded executables cannot execute on host (see https://github.com/flutter/flutter/issues/6207 for more information)

[✓] Android toolchain - develop for Android devices (Android SDK 26.0.2)
    • Android SDK at /usr/local/google/home/kinshul/Android/Sdk
    • Platform android-26, build-tools 26.0.2
    • Java binary at: /opt/android-studio-with-blaze-2.3/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)

[✓] Android Studio (version 2.3)
    • Android Studio at /opt/android-studio-with-blaze-2.3
    • Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)

[✓] IntelliJ IDEA Community Edition (version 2017.1)
    • Flutter plugin version 18.1
    • Dart plugin version 171.4694.29

[✓] Connected devices
    • Nexus 5X • 00da1e796fb1cf52 • android-arm • Android 6.0 (API 23)

&gt; For more information about diagnosing and reporting Flutter bugs, please see [https://flutter.io/bug-reports/](https://flutter.io/bug-reports/)."><pre class="notranslate"><code class="notranslate">[-] Flutter (on Linux, locale en_US.UTF-8, channel google3)
    • Flutter at /google/obj/workspace/d9981df61cffad7a0e5a854147e02734/ee049f8d-e0ae-4e42-ba92-614f4524525c/blaze-out/k8-opt/bin/mobile/flutter/tools/tools.runfiles/google3
    • Framework revision null (null), null
    • Engine revision null
    • Tools Dart version null
    ✗ Downloaded executables cannot execute on host (see https://github.com/flutter/flutter/issues/6207 for more information)

[✓] Android toolchain - develop for Android devices (Android SDK 26.0.2)
    • Android SDK at /usr/local/google/home/kinshul/Android/Sdk
    • Platform android-26, build-tools 26.0.2
    • Java binary at: /opt/android-studio-with-blaze-2.3/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)

[✓] Android Studio (version 2.3)
    • Android Studio at /opt/android-studio-with-blaze-2.3
    • Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)

[✓] IntelliJ IDEA Community Edition (version 2017.1)
    • Flutter plugin version 18.1
    • Dart plugin version 171.4694.29

[✓] Connected devices
    • Nexus 5X • 00da1e796fb1cf52 • android-arm • Android 6.0 (API 23)

&gt; For more information about diagnosing and reporting Flutter bugs, please see [https://flutter.io/bug-reports/](https://flutter.io/bug-reports/).
</code></pre></div>