Repository: flutter
Issue: The UI is not synchronized with the `Navigator.pages`.
Labels: package,has reproducible steps,P2,p: go_router,found in release: 3.0,found in release: 3.1,team-go_router,triaged-go_router

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

1. Run the sample app (I have run it in both the debug mode and the release mode). The problem is present in both modes.
2. The sample app has two screens. The first screen (i.e. the `HomeScreen`) has a button. Tap it will push the second screen to the [Navigator.pages](https://api.flutter.dev/flutter/widgets/Navigator/pages.html).
3. The second screen (i.e the `Screen2`) has three buttons. The handler functions of those buttons are the same. They try to remove the second screen from the `Navigator.pages`.
4. Now, go to the second screen. Tap the button in the center of the screen. The app will go back to the first screen as expected.
5. Now, go to the second screen again. Tap the _home_ icon in the top right corner. The app will also go back to the first screen as expected.
6. Go to the second screen once more. Tap the _menu_ icon in the top right corner. Tap the `*Go* To The Home Screen` button in the opened drawer. **The app should go back to the first screen. But it didn't.** And now, if we tap the button in the center of the screen or the _home_ icon in the top right corner, the app will stay on the second screen and we can't go back to the first screen unless we use the _system's back button_ (e.g. Android's back button).
7. Like I said, the handler functions of the three buttons are the same. But when the handler function being called in the drawer, it is not working.

I found it seemed that the `Navigator` did rebuilt the pages, but the UI stays on the second screen. I have investigated this problem for days, but can't figure it out.

<details>
<summary>Code sample</summary>

<!--
      Please create a minimal reproducible sample that shows the problem
      and attach it below between the lines with the backticks.

      To create it you can use `flutter create bug` command and update the `main.dart` file.

      Alternatively, you can use https://dartpad.dev/
      which is capable of creating and running small Flutter apps.

      Without this we will unlikely be able to progress on the issue, and because of that
      we regretfully will have to close it.
-->

Below is the sample app using `go_router`. I have reproduced the problem using [provider](https://pub.dev/packages/provider) and [go_router](https://pub.dev/packages/go_router). The problem is the same. So I don't think the problem has anything to do with these packages. I can add the reproduction code using `provider` if necessary. The behavior of the app is the same.

```dart
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

void main() => runApp(App());

class App extends StatelessWidget {
  App({Key? key}) : super(key: key);

  static const String title = 'The Reproducible Navigation Problem';

  @override
  Widget build(BuildContext context) => MaterialApp.router(
        routeInformationProvider: _router.routeInformationProvider,
        routeInformationParser: _router.routeInformationParser,
        routerDelegate: _router.routerDelegate,
        title: title,
      );

  final GoRouter _router = GoRouter(
    routes: <GoRoute>[
      GoRoute(
        path: '/',
        builder: (BuildContext context, GoRouterState state) =>
            const HomeScreen(),
      ),
      GoRoute(
        path: '/screen2',
        builder: (BuildContext context, GoRouterState state) => const Screen2(),
      ),
    ],
  );
}

class HomeScreen extends StatelessWidget {
  const HomeScreen({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) => Scaffold(
        appBar: AppBar(
          title: const Text('Home'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              const Text(
                'This is the home screen.',
                style: TextStyle(fontSize: 32),
              ),
              ElevatedButton(
                // !!!!!!!!!!!!!!!!!!!!!
                // Note the [push()] here.
                // !!!!!!!!!!!!!!!!!!!!!
                onPressed: () => context.push('/screen2'),
                child: const Text('*Push* The Screen2'),
              ),
            ],
          ),
        ),
      );
}

class Screen2 extends StatelessWidget {
  const Screen2({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) => Scaffold(
        appBar: AppBar(
          title: const Text('Screen2'),
          actions: [
            IconButton(
              // !!!!!!!!!!!!!!!!!!!!!
              // Note the [go()] here.
              // !!!!!!!!!!!!!!!!!!!!!
              onPressed: () => context.go('/'),
              icon: const Icon(Icons.home),
            ),
            Builder(builder: (context) {
              return IconButton(
                onPressed: () => Scaffold.of(context).openEndDrawer(),
                icon: const Icon(
                  Icons.menu,
                ),
              );
            }),
          ],
        ),
        endDrawer: const MenuDrawer(),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              const Text(
                'This is the screen 2.',
                style: TextStyle(fontSize: 32),
              ),
              ElevatedButton(
                // !!!!!!!!!!!!!!!!!!!!!
                // Note the [go()] here.
                // !!!!!!!!!!!!!!!!!!!!!
                onPressed: () => context.go('/'),
                child: const Text('*Go* To The Home Screen'),
              ),
            ],
          ),
        ),
      );
}

class MenuDrawer extends StatelessWidget {
  const MenuDrawer({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ElevatedButton(
      // !!!!!!!!!!!!!!!!!!!!!
      // Note the [go()] here.
      // !!!!!!!!!!!!!!!!!!!!!
      onPressed: () => context.go('/'),
      child: const Text('*Go* To The Home Screen'),
    );
  }
}
```

</details>

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue. If there is a crash, please include
      the entirety of the crash log including the backtrace.
-->

```
[  +60 ms] executing: uname -m
[  +32 ms] Exit code 0 from: uname -m
[        ] x86_64
[   +6 ms] executing: [/home/bo/snap/flutter/common/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +6 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] 85684f9300908116a78138ea4c6036c35c9a1236
[        ] executing: [/home/bo/snap/flutter/common/flutter/] git tag --points-at 85684f9300908116a78138ea4c6036c35c9a1236
[  +16 ms] Exit code 0 from: git tag --points-at 85684f9300908116a78138ea4c6036c35c9a1236
[        ] 3.0.4
[   +9 ms] executing: [/home/bo/snap/flutter/common/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[   +6 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [/home/bo/snap/flutter/common/flutter/] git ls-remote --get-url origin
[   +5 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +87 ms] executing: [/home/bo/snap/flutter/common/flutter/] git rev-parse --abbrev-ref HEAD
[   +8 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[   +1 ms] stable
[  +55 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +72 ms] executing: /home/bo/Android/Sdk/platform-tools/adb devices -l
[  +43 ms] List of devices attached
           VEG0220409008146       device usb:1-2 product:ANA-AN00 model:ANA_AN00 device:HWANA transport_id:4
[   +6 ms] /home/bo/Android/Sdk/platform-tools/adb -s VEG0220409008146 shell getprop
[  +66 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +119 ms] Skipping pub get: version match.
[  +69 ms] Generating /home/bo/temp/navigator_bug/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[  +42 ms] ro.hardware = kirin990
[        ] ro.build.characteristics = default
[  +34 ms] Initializing file store
[   +9 ms] Skipping target: gen_localizations
[   +5 ms] gen_dart_plugin_registrant: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated contents: /home/bo/temp/navigator_bug/.dart_tool/package_config_subset}
[  +23 ms] gen_dart_plugin_registrant: Complete
[   +1 ms] Skipping target: _composite
[   +1 ms] complete
[   +5 ms] Launching lib/main.dart on ANA AN00 in debug mode...
[   +4 ms] /home/bo/snap/flutter/common/flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev /home/bo/snap/flutter/common/flutter/bin/cache/dart-sdk/bin/snapshots/frontend_server.dart.snapshot --sdk-root /home/bo/snap/flutter/common/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/ --incremental --target=flutter --debugger-module-names --experimental-emit-debug-metadata -DFLUTTER_WEB_AUTO_DETECT=true --output-dill /tmp/flutter_tools.XNVTWP/flutter_tool.RXALLJ/app.dill --packages /home/bo/temp/navigator_bug/.dart_tool/package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts --track-widget-creation --filesystem-scheme org-dartlang-root --initialize-from-dill build/c075001b96339384a97db4862b8ab8db.cache.dill.track.dill --enable-experiment=alternative-invalidation-strategy
[   +7 ms] executing: /home/bo/Android/Sdk/build-tools/31.0.0/aapt dump xmltree /home/bo/temp/navigator_bug/build/app/outputs/flutter-apk/app.apk AndroidManifest.xml
[   +5 ms] Exit code 0 from: /home/bo/Android/Sdk/build-tools/31.0.0/aapt dump xmltree /home/bo/temp/navigator_bug/build/app/outputs/flutter-apk/app.apk AndroidManifest.xml
[        ] N: android=http://schemas.android.com/apk/res/android
             E: manifest (line=2)
               A: android:versionCode(0x0101021b)=(type 0x10)0x1
               A: android:versionName(0x0101021c)="1.0.0" (Raw: "1.0.0")
               A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1f
               A: android:compileSdkVersionCodename(0x01010573)="12" (Raw: "12")
               A: package="com.example.navigator_bug" (Raw: "com.example.navigator_bug")
               A: platformBuildVersionCode=(type 0x10)0x1f
               A: platformBuildVersionName=(type 0x10)0xc
               E: uses-sdk (line=7)
                 A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
                 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1f
               E: uses-permission (line=15)
                 A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
               E: application (line=17)
                 A: android:label(0x01010001)="navigator_bug" (Raw: "navigator_bug")
                 A: android:icon(0x01010002)=@0x7f080000
                 A: android:name(0x01010003)="android.app.Application" (Raw: "android.app.Application")
                 A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
                 A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw: "androidx.core.app.CoreComponentFactory")
                 E: activity (line=23)
                   A: android:theme(0x01010000)=@0x7f0a0000
                   A: android:name(0x01010003)="com.example.navigator_bug.MainActivity" (Raw: "com.example.navigator_bug.MainActivity")
                   A: android:exported(0x01010010)=(type 0x12)0xffffffff
                   A: android:launchMode(0x0101001d)=(type 0x10)0x1
                   A: android:configChanges(0x0101001f)=(type 0x11)0x40003fb4
                   A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10
                   A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff
                   E: meta-data (line=38)
                     A: android:name(0x01010003)="io.flutter.embedding.android.NormalTheme" (Raw: "io.flutter.embedding.android.NormalTheme")
                     A: android:resource(0x01010025)=@0x7f0a0001
                   E: intent-filter (line=42)
                     E: action (line=43)
                       A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
                     E: category (line=45)
                       A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")
                 E: meta-data (line=52)
                   A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
                   A: android:value(0x01010024)=(type 0x10)0x2
                 E: uses-library (line=56)
                   A: android:name(0x01010003)="androidx.window.extensions" (Raw: "androidx.window.extensions")
                   A: android:required(0x0101028e)=(type 0x12)0x0
                 E: uses-library (line=59)
                   A: android:name(0x01010003)="androidx.window.sidecar" (Raw: "androidx.window.sidecar")
                   A: android:required(0x0101028e)=(type 0x12)0x0
[   +6 ms] executing: /home/bo/Android/Sdk/platform-tools/adb -s VEG0220409008146 shell -x logcat -v time -t 1
[   +9 ms] <- compile package:navigator_bug/main.dart
[  +54 ms] --------- beginning of main
           07-18 00:46:18.190 D/LteRecoveryEngine( 2674): RecoveredState processMessage
[  +14 ms] executing: /home/bo/Android/Sdk/platform-tools/adb version
[   +8 ms] Android Debug Bridge version 1.0.41
           Version 31.0.3-7562133
           Installed as /home/bo/Android/Sdk/platform-tools/adb
[   +2 ms] executing: /home/bo/Android/Sdk/platform-tools/adb start-server
[   +8 ms] Building APK
[  +19 ms] Running Gradle task 'assembleDebug'...
[   +3 ms] Using gradle from /home/bo/temp/navigator_bug/android/gradlew.
[  +26 ms] executing: /home/bo/middle/android-studio/jre/bin/java -version
[  +81 ms] Exit code 0 from: /home/bo/middle/android-studio/jre/bin/java -version
[        ] openjdk version "11.0.8" 2020-07-14
           OpenJDK Runtime Environment (build 11.0.8+0-b944-P17168821)
           OpenJDK 64-Bit Server VM (build 11.0.8+0-b944-6842174, mixed mode)
[   +2 ms] executing: [/home/bo/temp/navigator_bug/android/] /home/bo/temp/navigator_bug/android/gradlew -Pverbose=true -Ptarget-platform=android-arm64 -Ptarget=/home/bo/temp/navigator_bug/lib/main.dart -Pbase-application-name=android.app.Application -Pdart-defines=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ== -Pdart-obfuscation=false -Ptrack-widget-creation=true -Ptree-shake-icons=false -Pfilesystem-scheme=org-dartlang-root assembleDebug
[+1186 ms] > Task :app:preBuild UP-TO-DATE
[   +1 ms] > Task :app:preDebugBuild UP-TO-DATE
[        ] > Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
[  +10 ms] > Task :app:compileFlutterBuildDebug UP-TO-DATE
[        ] > Task :app:packLibsflutterBuildDebug UP-TO-DATE
[        ] > Task :app:compileDebugAidl NO-SOURCE
[        ] > Task :app:compileDebugRenderscript NO-SOURCE
[        ] > Task :app:generateDebugBuildConfig UP-TO-DATE
[        ] > Task :app:checkDebugAarMetadata UP-TO-DATE
[        ] > Task :app:cleanMergeDebugAssets
[        ] > Task :app:mergeDebugShaders UP-TO-DATE
[  +76 ms] > Task :app:compileDebugShaders NO-SOURCE
[        ] > Task :app:generateDebugAssets UP-TO-DATE
[        ] > Task :app:mergeDebugAssets
[ +195 ms] > Task :app:copyFlutterAssetsDebug
[        ] > Task :app:generateDebugResValues UP-TO-DATE
[        ] > Task :app:generateDebugResources UP-TO-DATE
[ +100 ms] > Task :app:mergeDebugResources UP-TO-DATE
[        ] > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
[        ] > Task :app:extractDeepLinksDebug UP-TO-DATE
[        ] > Task :app:processDebugMainManifest UP-TO-DATE
[        ] > Task :app:processDebugManifest UP-TO-DATE
[        ] > Task :app:processDebugManifestForPackage UP-TO-DATE
[        ] > Task :app:processDebugResources UP-TO-DATE
[        ] > Task :app:compileDebugKotlin UP-TO-DATE
[        ] > Task :app:javaPreCompileDebug UP-TO-DATE
[        ] > Task :app:compileDebugJavaWithJavac UP-TO-DATE
[  +97 ms] > Task :app:processDebugJavaRes NO-SOURCE
[        ] > Task :app:mergeDebugJavaResource UP-TO-DATE
[        ] > Task :app:checkDebugDuplicateClasses UP-TO-DATE
[        ] > Task :app:dexBuilderDebug UP-TO-DATE
[        ] > Task :app:desugarDebugFileDependencies UP-TO-DATE
[  +98 ms] > Task :app:mergeExtDexDebug UP-TO-DATE
[   +2 ms] > Task :app:mergeDexDebug UP-TO-DATE
[        ] > Task :app:mergeDebugJniLibFolders UP-TO-DATE
[        ] > Task :app:mergeDebugNativeLibs UP-TO-DATE
[        ] > Task :app:stripDebugDebugSymbols UP-TO-DATE
[        ] > Task :app:validateSigningDebug UP-TO-DATE
[        ] > Task :app:writeDebugAppMetadata UP-TO-DATE
[        ] > Task :app:writeDebugSigningConfigVersions UP-TO-DATE
[ +695 ms] > Task :app:compressDebugAssets
[        ] Execution optimizations have been disabled for task ':app:compressDebugAssets' to ensure correctness due to the following reasons:
[        ]   - Gradle detected a problem with the following location: '/home/bo/temp/navigator_bug/build/app/intermediates/assets/debug/mergeDebugAssets'. Reason: Task ':app:compressDebugAssets' uses this output of task ':app:copyFlutterAssetsDebug' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4/userguide/validation_problems.html#implicit_dependency for more details about this problem.
[        ] > Task :app:packageDebug UP-TO-DATE
[        ] > Task :app:createDebugApkListingFileRedirect UP-TO-DATE
[ +198 ms] > Task :app:assembleDebug
[  +15 ms] Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
[        ] You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
[        ] See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings
[        ] Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
[        ] Please consult deprecation warnings for more details.
[        ] BUILD SUCCESSFUL in 2s
[        ] 35 actionable tasks: 5 executed, 30 up-to-date
[ +359 ms] Running Gradle task 'assembleDebug'... (completed in 3.1s)
[ +203 ms] calculateSha: LocalDirectory: '/home/bo/temp/navigator_bug/build/app/outputs/flutter-apk'/app.apk
[+1039 ms] ✓  Built build/app/outputs/flutter-apk/app-debug.apk.
[   +2 ms] executing: /home/bo/Android/Sdk/build-tools/31.0.0/aapt dump xmltree /home/bo/temp/navigator_bug/build/app/outputs/flutter-apk/app.apk AndroidManifest.xml
[   +9 ms] Exit code 0 from: /home/bo/Android/Sdk/build-tools/31.0.0/aapt dump xmltree /home/bo/temp/navigator_bug/build/app/outputs/flutter-apk/app.apk AndroidManifest.xml
[        ] N: android=http://schemas.android.com/apk/res/android
             E: manifest (line=2)
               A: android:versionCode(0x0101021b)=(type 0x10)0x1
               A: android:versionName(0x0101021c)="1.0.0" (Raw: "1.0.0")
               A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1f
               A: android:compileSdkVersionCodename(0x01010573)="12" (Raw: "12")
               A: package="com.example.navigator_bug" (Raw: "com.example.navigator_bug")
               A: platformBuildVersionCode=(type 0x10)0x1f
               A: platformBuildVersionName=(type 0x10)0xc
               E: uses-sdk (line=7)
                 A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
                 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1f
               E: uses-permission (line=15)
                 A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
               E: application (line=17)
                 A: android:label(0x01010001)="navigator_bug" (Raw: "navigator_bug")
                 A: android:icon(0x01010002)=@0x7f080000
                 A: android:name(0x01010003)="android.app.Application" (Raw: "android.app.Application")
                 A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
                 A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw: "androidx.core.app.CoreComponentFactory")
                 E: activity (line=23)
                   A: android:theme(0x01010000)=@0x7f0a0000
                   A: android:name(0x01010003)="com.example.navigator_bug.MainActivity" (Raw: "com.example.navigator_bug.MainActivity")
                   A: android:exported(0x01010010)=(type 0x12)0xffffffff
                   A: android:launchMode(0x0101001d)=(type 0x10)0x1
                   A: android:configChanges(0x0101001f)=(type 0x11)0x40003fb4
                   A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10
                   A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff
                   E: meta-data (line=38)
                     A: android:name(0x01010003)="io.flutter.embedding.android.NormalTheme" (Raw: "io.flutter.embedding.android.NormalTheme")
                     A: android:resource(0x01010025)=@0x7f0a0001
                   E: intent-filter (line=42)
                     E: action (line=43)
                       A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
                     E: category (line=45)
                       A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")
                 E: meta-data (line=52)
                   A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
                   A: android:value(0x01010024)=(type 0x10)0x2
                 E: uses-library (line=56)
                   A: android:name(0x01010003)="androidx.window.extensions" (Raw: "androidx.window.extensions")
                   A: android:required(0x0101028e)=(type 0x12)0x0
                 E: uses-library (line=59)
                   A: android:name(0x01010003)="androidx.window.sidecar" (Raw: "androidx.window.sidecar")
                   A: android:required(0x0101028e)=(type 0x12)0x0
[   +1 ms] Stopping app 'app.apk' on ANA AN00.
[        ] executing: /home/bo/Android/Sdk/platform-tools/adb -s VEG0220409008146 shell am force-stop com.example.navigator_bug
[ +106 ms] executing: /home/bo/Android/Sdk/platform-tools/adb -s VEG0220409008146 shell pm list packages com.example.navigator_bug
[  +49 ms] package:com.example.navigator_bug
[   +6 ms] executing: /home/bo/Android/Sdk/platform-tools/adb -s VEG0220409008146 shell cat /data/local/tmp/sky.com.example.navigator_bug.sha1
[  +34 ms] ca970985a1dcbfc66058621f2036674e5117bc84
[   +1 ms] Latest build already installed.
[        ] executing: /home/bo/Android/Sdk/platform-tools/adb -s VEG0220409008146 shell -x logcat -v time -t 1
[  +44 ms] --------- beginning of system
           07-18 00:46:23.132 D/HwCommandQueue( 2465): CommandQueue, set Launcher StatusBar Color
[  +25 ms] executing: /home/bo/Android/Sdk/platform-tools/adb -s VEG0220409008146 shell am start -a android.intent.action.RUN -f 0x20000000 --ez enable-dart-profiling true --ez enable-checked-mode true --ez verify-entry-points true com.example.navigator_bug/com.example.navigator_bug.MainActivity
[  +63 ms] Starting: Intent { act=android.intent.action.RUN flg=0x20000000 cmp=com.example.navigator_bug/.MainActivity (has extras) }
[        ] Waiting for observatory port to be available...
[ +306 ms] Observatory URL on device: http://127.0.0.1:44147/CZuqOb1CH5s=/
[   +3 ms] executing: /home/bo/Android/Sdk/platform-tools/adb -s VEG0220409008146 forward tcp:0 tcp:44147
[  +15 ms] 37465
[        ] Forwarded host port 37465 to device port 44147 for Observatory
[  +10 ms] Caching compiled dill
[ +104 ms] Connecting to service protocol: http://127.0.0.1:37465/CZuqOb1CH5s=/
[ +198 ms] Launching a Dart Developer Service (DDS) instance at http://127.0.0.1:0, connecting to VM service at http://127.0.0.1:37465/CZuqOb1CH5s=/.
[ +202 ms] DDS is listening at http://127.0.0.1:42825/v989OZwRzfY=/.
[  +51 ms] Successfully connected to service protocol: http://127.0.0.1:37465/CZuqOb1CH5s=/
[ +138 ms] DevFS: Creating new filesystem on the device (null)
[  +20 ms] DevFS: Created new filesystem on the device (file:///data/user/0/com.example.navigator_bug/code_cache/navigator_bugNSOFTW/navigator_bug/)
[   +3 ms] Updating assets
[  +78 ms] Syncing files to device ANA AN00...
[   +1 ms] <- reset
[        ] Compiling dart to kernel with 0 updated files
[        ] Processing bundle.
[        ] <- recompile package:navigator_bug/main.dart 3c5b4875-3e1e-447e-8893-1adf8a19aca1
[        ] <- 3c5b4875-3e1e-447e-8893-1adf8a19aca1
[   +1 ms] Bundle processing done.
[   +1 ms] W/Gralloc3( 9032): mapper 3.x is not supported
[ +170 ms] Updating files.
[        ] DevFS: Sync finished
[   +3 ms] Syncing files to device ANA AN00... (completed in 177ms)
[   +1 ms] Synced 0.0MB.
[   +4 ms] <- accept
[  +12 ms] Connected to _flutterView/0x73d0975820.
[   +8 ms] Flutter run key commands.
[   +3 ms] r Hot reload. 🔥🔥🔥
[   +1 ms] R Hot restart.
[        ] h List all available interactive commands.
[        ] d Detach (terminate "flutter run" but leave application running).
[        ] c Clear the screen
[        ] q Quit (terminate the application on the device).
[        ] 💪 Running with sound null safety 💪
[   +1 ms] An Observatory debugger and profiler on ANA AN00 is available at: http://127.0.0.1:42825/v989OZwRzfY=/
[  +15 ms] The Flutter DevTools debugger and profiler on ANA AN00 is available at: http://127.0.0.1:9104?uri=http://127.0.0.1:42825/v989OZwRzfY=/
[+1729 ms] I/Hwaps   ( 9032): APS: EventAnalyzed: initAPS: version is 11.0.0.4
[   +2 ms] D/Hwaps   ( 9032): Fpsrequest create,type:EXACTLY_IDENTIFY
[        ] D/Hwaps   ( 9032): Fpsrequest create,type:EXACTLY_IDENTIFY
[        ] D/Hwaps   ( 9032): Fpsrequest create,type:OPENGL_SETTING
[        ] D/Hwaps   ( 9032): FpsController create
[        ] D/Hwaps   ( 9032): APS: EventAnalyzed: reInitFpsPara :mBaseFps = 60; mMaxFps = 60
[        ] W/Settings( 9032): Setting device_provisioned has moved from android.provider.Settings.Secure to android.provider.Settings.Global.
[        ] V/HiTouch_HiTouchSensor( 9032): User setup is finished.
[  +44 ms] W/HwApsManager( 9032): HwApsManagerService, registerCallback, start !
[   +2 ms] D/Hwaps   ( 9032): APS: EventAnalyzed: registerCallbackInApsManagerService, mPkgName:com.example.navigator_bug; result = true
[  +75 ms] V/AudioManager( 9032): querySoundEffectsEnabled...
[+1913 ms] I/AwareBitmapCacher( 9032): init lrucache size: 2097152 pid=9032
[ +317 ms] V/AudioManager( 9032): querySoundEffectsEnabled...
[ +938 ms] V/AudioManager( 9032): querySoundEffectsEnabled...
[+5132 ms] V/AudioManager( 9032): querySoundEffectsEnabled...
[ +985 ms] V/AudioManager( 9032): querySoundEffectsEnabled...
[   +7 ms] I/HWRME LIBHWRME_CLIENT( 9032): ResMngAction: check app type: pid=9032;appType=-1
[ +892 ms] V/AudioManager( 9032): querySoundEffectsEnabled...
[+1220 ms] V/AudioManager( 9032): querySoundEffectsEnabled...
[+1860 ms] V/AudioManager( 9032): querySoundEffectsEnabled...
[ +982 ms] V/AudioManager( 9032): querySoundEffectsEnabled...
[+3487 ms] Application finished.
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
Analyzing navigator_bug...
No issues found! (ran in 1.5s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel stable, 3.0.4, on Ubuntu 20.04.4 LTS 5.15.0-41-generic, locale en_US.UTF-8)
    • Flutter version 3.0.4 at /home/bo/snap/flutter/common/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 85684f9300 (2 weeks ago), 2022-06-30 13:22:47 -0700
    • Engine revision 6ba2af10bb
    • Dart version 2.17.5
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /home/bo/Android/Sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /home/bo/middle/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+0-b944-P17168821)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
    • cmake version 3.10.2
    • ninja version 1.8.2
    • pkg-config version 0.29.1

[✓] Android Studio (version 4.2)
    • Android Studio at /home/bo/middle/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8+0-b944-P17168821)

[✓] VS Code (version 1.69.1)
    • VS Code at /usr/share/code
    • Flutter extension version 3.44.0

[✓] Proxy Configuration
    • HTTP_PROXY is set
    • NO_PROXY is storage.googleapis.com,localhost,127.0.0.1,::1
    • NO_PROXY contains localhost
    • NO_PROXY contains 127.0.0.1
    • NO_PROXY contains ::1

[✓] Connected device (3 available)
    • ANA AN00 (mobile) • VEG0220409008146 • android-arm64  • Android 10 (API 29)
    • Linux (desktop)   • linux            • linux-x64      • Ubuntu 20.04.4 LTS 5.15.0-41-generic
    • Chrome (web)      • chrome           • web-javascript • Google Chrome 103.0.5060.114

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
```

</details>

<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->

![navigator3](https://user-images.githubusercontent.com/3930291/179417715-499554c4-23af-42ff-82a8-18e9ecd5a01f.jpg)