Repository: flutter
Issue: RouteAware didPushNext not called when initial route creates multiple routes
Labels: framework,f: routes,has reproducible steps,P2,found in release: 3.7,found in release: 3.8,team-framework,triaged-framework

Consider an initial route like "/screen2" - this initial route automatically leads to the creation of both "/" and "/screen2", with the 2nd screen placed on top of the first. Both widgets are instantiated, both widgets are initialized, both widgets are built, and if both screens implement `RouteAware`, then both screens have their `didPush()` method invoked.

However, screen 1, AKA "/", never has its `didPushNext()` invoked.

This issue was raised but previously closed: 
https://github.com/flutter/flutter/issues/55949#event-3284551599

I don't think that issue should have been closed. I believe the `RouteAware` contract is not being honored. The API doc for `didPushNext()` reads:

```
/// Called when a new route has been pushed, and the current route is no
/// longer visible.
```

Even though route "/" and route "/screen2" are built back to back as quickly as possible, they are absolutely different route objects, with different route names, and "/screen2" does cause "/" to lose visibility. Therefore, "didPushNext()" should be invoked.

In my particular case, I'm dealing with a QR code plugin, which expects a `RenderBox` to report a size as soon as the QR widget is initialized. This is a poor assumption, but I don't have control over that plugin. I need to be able to avoid building that QR view widget when "/" is not visible. I currently don't see any non-hacky way to handle that because `didPushNext()` is not invoked as per its contract.

Here is a complete and minimal reproduction of the situation:

```
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

final RouteObserver _routeObserver = RouteObserver();

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Bug - Route Aware, Initial Route',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      initialRoute: '/screen2',
      routes: {
        '/': (_) => Screen1(),
        '/screen2': (_) => Screen2(),
      },
      navigatorObservers: [_routeObserver],
    );
  }
}

class Screen1 extends StatefulWidget {
  @override
  _Screen1State createState() => _Screen1State();
}

class _Screen1State extends State<Screen1> implements RouteAware {
  @override
  void didChangeDependencies() {
    super.didChangeDependencies();
    _routeObserver.subscribe(this, ModalRoute.of(context));
  }

  @override
  void dispose() {
    _routeObserver.unsubscribe(this);
    super.dispose();
  }

  @override
  void didPop() {
    print('Screen 1: didPop()');
  }

  @override
  void didPopNext() {
    print('Screen 1: didPopNext()');
  }

  @override
  void didPush() {
    print('Screen 1: didPush()');
  }

  @override
  void didPushNext() {
    print('Screen 1: didPushNext()');
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Text('Screen 1'),
      ),
    );
  }
}

class Screen2 extends StatefulWidget {
  @override
  _Screen2State createState() => _Screen2State();
}

class _Screen2State extends State<Screen2> implements RouteAware {
  @override
  void didChangeDependencies() {
    super.didChangeDependencies();
    _routeObserver.subscribe(this, ModalRoute.of(context));
  }

  @override
  void dispose() {
    _routeObserver.unsubscribe(this);
    super.dispose();
  }

  @override
  void didPop() {
    print('Screen 2: didPop()');
  }

  @override
  void didPopNext() {
    print('Screen 2: didPopNext()');
  }

  @override
  void didPush() {
    print('Screen 2: didPush()');
  }

  @override
  void didPushNext() {
    print('Screen 2: didPushNext()');
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Text('Screen 2'),
      ),
    );
  }
}
```

Output from repro:
```
flutter: Screen 1: didPush()
flutter: Screen 2: didPush()
```

Flutter version:
```
Flutter 1.22.0-10.0.pre.9 • channel master • git@github.com:flutter/flutter.git
Framework • revision 8fa5c55e54 (2 months ago) • 2020-08-30 19:05:20 -0700
Engine • revision 1e302a111d
Tools • Dart 2.10.0 (build 2.10.0-76.0.dev)
```