Repository: flutter
Issue: [go_router][web] GoRouter's `refresh` method stops refreshing the current route starting from version `13.0.0`
Labels: platform-web,package,has reproducible steps,p: go_router,team-web,found in release: 3.24,found in release: 3.27

### Steps to reproduce

I have some functionality in my project where the current route must be refreshed after some user action. Depending of those user action the content of widget which represents a current route must be rebuilt. My functionality is working good under version  `12.1.3`. Starting from `13.0.0` it stops working, so I cannot use new version of `GoRouter` without lost of my funcitonality.

It is naturally I cannot to re-create the full functionality of my project but I tried to create some reproduceable example.

Just run the sample with version of `go_router` `12.1.3` and click the button.  It just calls the `refresh` method. You will see that the time string is changed. Then change the version of `go_router` to `13.0.0` or any above, restart the project and click the button. You will see that the time string stops updating.

### Expected results

The widget `Home` must be refreshed (the `build` method must be called).
The difference between this sample and my code is: in my code the widget is re-created (`initState` is called) in this sample the widget is updated (`updateWidget` is called).

### Actual results

The widget `Home` is not refreshed (the `build` method is not called.).

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

void main() {
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      routerConfig: _router,
    );
  }
}

final _router = GoRouter(
  debugLogDiagnostics: true,
  initialLocation: '/',
  routes: [
    GoRoute(
      path: '/',
      name: 'root',
      redirect: (context, state) {
        return '/home';
      },
    ),
    GoRoute(
      path: '/home',
      name: 'home',
      pageBuilder: (context, state) {
        return WebPage(
          title: 'Home',
          child: Home(),
        );
      },
      redirect: (context, state) {
        return '/home';
      },
    ),
  ],
);

class Home extends StatefulWidget {
  // ignore: prefer_const_constructors_in_immutables
  Home() : super(key: const ValueKey('/home'));

  @override
  State<Home> createState() => _HomeState();
}

class _HomeState extends State<Home> {
  @override
  Widget build(BuildContext context) {
    if (kDebugMode) {
      print('build $this');
    }
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Text(DateTime.now().toIso8601String()),
            const SizedBox(height: 20),
            ElevatedButton(
              onPressed: () {
                GoRouter.of(context).refresh();
              },
              child: const Text('Refresh route'),
            ),
          ],
        ),
      ),
    );
  }
}

class WebPage extends CustomTransitionPage {
  WebPage({
    super.key,
    required String title,
    super.maintainState,
    super.fullscreenDialog,
    super.name,
    super.arguments,
    super.restorationId,
    required Widget child,
  }) : super(
          child: WebScaffold(
            title: title,
            body: child,
          ),
          transitionsBuilder: (context, animation, _, child) {
            return FadeTransition(
              opacity: animation,
              child: child,
            );
          },
        );
}

class WebScaffold extends StatefulWidget {
  const WebScaffold({super.key, required this.title, required this.body});

  final Widget body;
  final String title;

  @override
  State<WebScaffold> createState() => _WebScaffoldState();
}

class _WebScaffoldState extends State<WebScaffold> {
  @override
  Widget build(BuildContext context) {
    return Title(
      title: widget.title,
      color: Theme.of(context).colorScheme.primary,
      child: widget.body,
    );
  }
}

```

</details>

### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.22631.4460], locale en-NL)
    • Flutter version 3.24.3 on channel stable at C:\data\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2663184aa7 (3 months ago), 2024-09-11 16:27:48 -0500
    • Engine revision 36335019a8
    • Dart version 3.5.3
    • DevTools version 2.37.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\at\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2023.2)
    • 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 17.0.9+0--11185874)

[√] VS Code (version 1.95.3)
    • VS Code at C:\Users\at\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.100.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22631.4460]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 131.0.6778.86
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 123.0.2420.65
```

</details>