Repository: flutter
Issue: After using PathUrlStrategy for removing the '#' sign, WillPopScope's onWillPop is not called when pressing the browser's back button.
Labels: framework,f: routes,platform-web,has reproducible steps,P2,found in release: 3.7,found in release: 3.11,team-web,triaged-web

initial route: http://localhost:63391/home
I change to http://localhost:63391/home/a
I click the browser back button.
Expected result:
onWillPop is called.
Actual result:
onWillPop is not called.

<details> 
<summary>flutter doctor -v</summary> 
	
```console
C:\Users\Rony\AndroidStudioProjects\watoobi\watoobi>flutter doctor -v
[√] Flutter (Channel stable, 2.0.5, on Microsoft Windows [Version 10.0.19041.928], locale en-US)
    • Flutter version 2.0.5 at c:\flutter\flutter
    • Framework revision adc687823a (4 weeks ago), 2021-04-16 09:40:20 -0700
    • Engine revision b09f014e96
    • Dart version 2.12.3

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\Rony\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = C:\Users\Rony\AppData\Local\Android\sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.1.0)
    • 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 1.8.0_242-release-1644-b01)

[√] Connected device (3 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 10 (API 29) (emulator)
    • Chrome (web)                       • chrome        • web-javascript • Google Chrome 90.0.4430.93
    • Edge (web)                         • edge          • web-javascript • Microsoft Edge 90.0.818.56

• No issues found!
```

</details>

code: 

<details> 
<summary>minimal code sample</summary> 

```dart
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';

void main() {
  setUrlStrategy(PathUrlStrategy());
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  MyAppState createState() => MyAppState();
}

class MyAppState extends State<MyApp> {
  @override
  void dispose() {
    super.dispose();
  }

  @override
  void initState() {
    super.initState();
  }

// This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return getMaterialApp(context);
  }

  Widget getMaterialApp(BuildContext context) {
    return MaterialApp(
      onGenerateRoute: generateRoute,
      onGenerateInitialRoutes: (url) {
        print('onGenerateInitialRoutes called');
        return [MaterialPageRoute(builder: (context) => MyHomePage(), settings: RouteSettings(name: url))];
      },
      onUnknownRoute: (settings) => MaterialPageRoute(builder: (context) => MyHomePage(), settings: RouteSettings(name: settings.name)),
      initialRoute: '/home',
    );
  }
}

Route<dynamic> generateRoute(RouteSettings settings) {
  print('generateRoute');
  print(settings.name);
  return MaterialPageRoute(builder: (context) => MyHomePage(), settings: RouteSettings(name: settings.name));
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return WillPopScope(
      onWillPop: () async {
        print('here');
        return false;
      },
      child: Scaffold(
        body: Center(
          child: SelectableText("test"),
        ),
      ),
    );
  }
}
``` 

</details>


in yaml, add:

<details> 
<summary>pubspec.yaml</summary> 
	
```yaml
flutter_web_plugins:
    sdk: flutter
```
name: bug
description: A new Flutter project.

publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  flutter_web_plugins:
    sdk: flutter

  cupertino_icons: ^1.0.2

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:

  uses-material-design: true
```

</details>