Repository: flutter
Issue: [go_router] Expected pushNamed to carry parent params forward to nested routes
Labels: package,has reproducible steps,P2,p: go_router,found in release: 3.7,found in release: 3.8,team-go_router,triaged-go_router

When calling a nested route via pushNamed, we have to push with the params explicitly defined for the entire path. This may be fine for immediate children, but multi-nested children shouldn't really need to know the params of parents 2 or more levels up in order to build up a proper map for the pushNamed call. This also can cause quite a lot of confusion when using URL Strategy and to other application developers in general since you can just arbitrarily set any path parameter in the chain to anything you want while hitting the back button in the app will send it back to the expected URL/Params of the page in the stack.  

I'm assuming this is intended behaviour, however, what is the best practice/examples of handling params higher in the parent route stack in nested routes? Better yet, how to only using pushNamed with the relevant params needed for that particular route and let gorouter handle filling in the path params for the missing parent ones? 

### Reproducible Example 

<details><summary>Code Sample</summary>

```dart 
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

final router = GoRouter(initialLocation: '/', routes: [
  GoRoute(
      path: '/',
      name: 'homepage',
      builder: (_, state) {
        return HomePage(key: state.pageKey);
      },
      routes: [
        GoRoute(
          path: ':fpid',
          name: 'firstpage',
          builder: (_, state) {
            print("State Params of First Page: ${state.params}");
            return FirstPage(key: state.pageKey, id: state.params['fpid']);
          },
          routes: [
            GoRoute(
              name: 'secondpage',
              path: ':spid',
              builder: (_, state) {
                print("State Params of Second Page: ${state.params}");
                return SecondPage(
                    key: state.pageKey, parentId: state.params['spid']);
              },
            ),
          ],
        )
      ])
]);

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      routerDelegate: router.routerDelegate,
      routeInformationParser: router.routeInformationParser,
      debugShowCheckedModeBanner: false,
    );
  }
}

class HomePage extends StatelessWidget {
  const HomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text("Home")),
      body: Container(
          alignment: Alignment.center,
          child: Column(children: [
            TextButton(
                onPressed: () => GoRouter.of(context)
                    .pushNamed("firstpage", params: {"fpid": "FPID1"}),
                child: const Text("Go To First Page"))
          ])),
    );
  }
}

class FirstPage extends StatelessWidget {
  const FirstPage({super.key, required this.id});

  final String? id;

  @override
  Widget build(BuildContext context) {
    print("First Page ID: $id");
    return Scaffold(
      appBar: AppBar(title: const Text("First Page")),
      body: Container(
          alignment: Alignment.center,
          child: Column(children: [
            Text("FPID: $id"),
            TextButton(
                onPressed: () => GoRouter.of(context)
                    .pushNamed("secondpage", params: {"fpid": "DIFFERENTFPID1","spid": "SPID1"}),
                child: const Text("Go To Second Page"))
          ])),
    );
  }
}

class SecondPage extends StatelessWidget {
  const SecondPage({super.key, required this.parentId});

  final String? parentId;

  @override
  Widget build(BuildContext context) {
    print("Second Page ParentID: $parentId");
    return Scaffold(
      appBar: AppBar(title: const Text("Second Page")),
      body: Container(
          alignment: Alignment.center,
          child: Column(children: [
            Text("SPID: $parentId"),
          ])),
    );
  }
}

```

</details>

 - [Run the sample on DartPad](https://dartpad.dev/?id=55929a8a0cbd0072f556d1dc81adf1f1)

Below is a console readout showing what the state params are showing for each route as you pushNamed. Note that I arbitrarily added a different FPID for the second page push which changes the URL and params for that route. Luckily the parent route retains it's param states. 

```console
//Below is result of the "Go To First Page" click
State Params of First Page: {fpid: FPID1}
First Page ID: FPID1

//Below is the result of the "Go To Second Page" click
State Params of Second Page: {fpid: DIFFERENTFPID1, spid: SPID1}
Second Page ParentID: SPID1
State Params of First Page: {fpid: FPID1}
First Page ID: FPID1
```

Also note, that if this was ran in the browser with a URL strategy it would look like this: 

```console
When pushing the first page

     /home/FPID1

When pushing the second page

     /home/DIFFERENTFPID1/SPID1

When hitting back button to pop the second page and going back to first page 

     /home/FPID1
```

<details><summary>stable flutter doctor -v</summary>

```console
[✓] Flutter (Channel stable, 3.7.3, on macOS 13.1 22C65 darwin-x64, locale en-US)
    • Flutter version 3.7.3 on channel stable at /Users/b/Documents/development/tools/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9944297138 (13 days ago), 2023-02-08 15:46:04 -0800
    • Engine revision 248290d6d5
    • Dart version 2.19.2
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/b/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/b/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • 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.11+0-b60-7590822)

[✓] VS Code (version 1.75.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.58.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 13.1 22C65 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 110.0.5481.100

[✓] HTTP Host Availability
    • All required HTTP hosts are available
```
</details>