Repository: flutter
Issue: [go_router] Parent route params is not available for child routes to access, while using named navigation
Labels: package,has reproducible steps,P2,p: go_router,found in release: 3.3,workaround available,found in release: 3.7,team-go_router,triaged-go_router

## Steps to Reproduce


1. Run the **Code Sample** provided below, the initial page will be `/flight`.
2. Tap on the **Go to Next Page** button, the page navigates to `/flight/book`.
3. Remove the `params` from the route named **service**.
4. Repeat steps **1** & **2**.

<details>
<summary>Code Sample</summary>

```dart
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

final router = GoRouter(
  initialLocation: '/flight',
  routes: [
    ShellRoute(
      builder: (context, state, child) {
        return Scaffold(
          body: child,
          bottomNavigationBar: Text(state.location),
        );
      },
      routes: [
        GoRoute(
          path: '/:service',
          name: 'service',
          builder: (context, state) {
            return Page(
              onTap: () => router.goNamed(
                'booking',
                params: {'service': 'flight'},   // <----- This should not be needed.
              ),
            );
          },
          routes: [
            GoRoute(
              path: 'book',
              name: 'booking',
              builder: (context, state) => const Page(),
            ),
          ],
        ),
      ],
    ),
  ],
);

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      title: 'Go Router Param Demo',
      theme: ThemeData.from(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      routerConfig: router,
    );
  }
}

class Page extends StatelessWidget {
  const Page({
    super.key,
    this.onTap,
  });

  final VoidCallback? onTap;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text(GoRouterState.of(context).location)),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            const SizedBox(height: 16),
            ElevatedButton(
              onPressed: onTap,
              child: const Text('Go to Next Page'),
            ),
          ],
        ),
      ),
    );
  }
}
```

</details>

`Tested with:` **go_router: ^6.0.0** 

**Expected results:**
Navigates to booking page without having to add route params, as it should grab it from its parent routes.


**Actual results:**
The navigation fails with the following stack trace.
```shell
======== Exception caught by gesture ===============================================================
The following assertion was thrown while handling a gesture:
missing param "service" for /:service/book
'package:go_router/src/configuration.dart':
Failed assertion: line 149 pos 16: 'params.containsKey(paramName)'

When the exception was thrown, this was the stack: 
#2      RouteConfiguration.namedLocation.<anonymous closure> (package:go_router/src/configuration.dart:149:16)
#3      RouteConfiguration.namedLocation (package:go_router/src/configuration.dart:158:6)
#4      GoRouter.namedLocation (package:go_router/src/router.dart:174:45)
#5      GoRouter.goNamed (package:go_router/src/router.dart:201:9)
#6      router.<anonymous closure>.<anonymous closure> (package:go_router_query_demo/main.dart:20:35)
```

P.S. Getting same error with `pushNamed` as well.

<details>
  <summary>flutter doctor -v</summary>

```
[✓] Flutter (Channel stable, 3.3.10, on macOS 13.1 22C65 darwin-arm, locale
    en-NP)
    • Flutter version 3.3.10 on channel stable at
      /Users/sarbagya/Development/flutter
    • Upstream repository ssh://git@github.com/flutter/flutter.git
    • FLUTTER_GIT_URL = ssh://git@github.com/flutter/flutter.git
    • Framework revision 135454af32 (5 days ago), 2022-12-15 07:36:55 -0800
    • Engine revision 3316dd8728
    • Dart version 2.18.6
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/sarbagya/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • ANDROID_HOME = /Users/sarbagya/Library/Android/sdk
    • Java binary at: /Users/sarbagya/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.7172.25.2113.9123335
      /Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14B47b
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /Users/sarbagya/Development/chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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.73.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.42.0

[✓] Connected device (3 available)
    • iPhone 14 Pro Max (mobile) • A4987323-FA06-400E-99D9-4909D34428C8 • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-16-1 (simulator)
    • macOS (desktop)            • macos                                •
      darwin-arm64   • macOS 13.1 22C65 darwin-arm
    • Chrome (web)               • chrome                               •
      web-javascript • unknown

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
```
</details>