Repository: flutter
Issue: MaterialPage causes different behaviour of the Navigator 2.0 than other Page
Labels: framework,f: routes,has reproducible steps,P2,found in release: 3.3,found in release: 3.7,team-framework,triaged-framework

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

1. Execute `flutter run` on the code sample
2. Click "click me" button couple of times and observe that nothing changes
3. Uncomment line 60 and comment line 62
4. Click "click me" button couple of times and observe that thansition occurs

**Expected results:**
Behaviour is the same for both types of Page

**Actual results:**
Behaviour is different

<details>
<summary>Code sample</summary>

https://dartpad.dev/?id=71a93e260fe2e089de45d29679cd23db

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp(),);
}

class MyApp extends StatelessWidget {
  MyApp({super.key}) : _routerDelegate = AppRouterDelegate();
  final RouterDelegate<AppState> _routerDelegate;

  @override
  Widget build(BuildContext context) => 
    MaterialApp.router(
      title: 'Test',
      routerDelegate: _routerDelegate,
      routeInformationParser: AppRouteInformationParser(),
      backButtonDispatcher: RootBackButtonDispatcher(),
    );
}

class AppRouteInformationParser extends RouteInformationParser<AppState> {

  @override
  Future<AppState> parseRouteInformation(RouteInformation routeInformation) {
    final AppState configuration = AppState();
    final uri = Uri.parse(routeInformation.location!);

    if (uri.pathSegments.isEmpty) {
        configuration.home = null;
    } else if (uri.pathSegments.length == 1 && uri.pathSegments.first == 'true') { 
        configuration.home = true;
    } else {
      configuration.home = false;
    }

    return Future.value(configuration);
  }

  @override 
  RouteInformation? restoreRouteInformation(AppState configuration) => 
    RouteInformation(location: configuration.home == null ? "/" : "/${configuration.home}",);
}

class AppRouterDelegate extends RouterDelegate<AppState> with ChangeNotifier, PopNavigatorRouterDelegateMixin<AppState> {

  @override
  final GlobalKey<NavigatorState> navigatorKey;

  AppRouterDelegate() : navigatorKey = GlobalKey<NavigatorState>();

  @override
  Widget build(final BuildContext context) =>
    Navigator(
      key: navigatorKey,
      pages: [
        if(_configuration?.home ?? false)
          TransitionPage(child: SomeScreen("Home", _configuration, key: const ValueKey('home')),)
        else
          //uncomment me:
          //MaterialPage(child: SomeScreen("Other", _configuration, key: const  ValueKey('other')),)
          //comment me:
          TransitionPage(child: SomeScreen("Other", _configuration, key: const  ValueKey('other')),)

      ],
      onPopPage: (route, result) {
        if (!route.didPop(result)) {
          return false;
        }
        
        _configuration?._home = ! (_configuration?._home ?? false);
        return true;
      },
    );

  AppState? _configuration;
  @override
  AppState? get currentConfiguration => _configuration;

  @override
  Future<void> setNewRoutePath(final AppState configuration) async {
    _configuration?.removeListener(notifyListeners);
    _configuration = configuration;
    _configuration?.addListener(notifyListeners);
  }
}

class TransitionPage extends Page {
  final Widget child;
  const TransitionPage({required this.child, super.key});

  @override
  Route createRoute(BuildContext context) {
    return PageRouteBuilder(
      settings: this,
      pageBuilder: (context, animation, animation2) {
        final tween = Tween(begin: const Offset(0.0, 1.0), end: Offset.zero);
        final curveTween = CurveTween(curve: Curves.easeInOut);
        return SlideTransition(
          position: animation.drive(curveTween).drive(tween),
          child: child,
        );
      },
    );
  }
}

class SomeScreen extends StatelessWidget {
  const SomeScreen(this.text, this._appState, {super.key});
  final String text;
  final AppState? _appState;

  @override
  Widget build(BuildContext context) =>
    Scaffold(
      appBar: AppBar(),
      body: Column(children: [
        Text(text),
        ElevatedButton(
          onPressed: () {
            _appState?.home = !(_appState?.home ?? false);
          },
          child: const Text("click me"))
      ],)
    ); 
}

class AppState extends ChangeNotifier {
  bool? _home = false;

  bool? get home => _home;

  set home(bool? home) {
    _home = home;
    notifyListeners();
  }
}
```

</details>

<details>
  <summary>Logs</summary>

```
no logs
```

```
No issues found!
```

```
[√] Flutter (Channel stable, 3.3.4, on Microsoft Windows [Version 10.0.19044.2006], locale pl-PL)
    • Flutter version 3.3.4 on channel stable at C:\Users\User\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision eb6d86ee27 (3 months ago), 2022-10-04 22:31:45 -0700
    • Engine revision c08d7d5efc
    • Dart version 2.18.2
    • DevTools version 2.15.0

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\User\AppData\Local\Android\sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2021.3)
    • Android Studio at C:\Program Files\Android\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.13+0-b1751.21-8125866)

[√] VS Code (version 1.74.2)
    • VS Code at C:\Users\User\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.56.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19044.2006]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 107.0.5304.123
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 107.0.1418.42

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.
```

</details>