Repository: flutter
Issue: [go_router] Implement the method `goBranchPath` for StatefulNavigationShell similar to `go`
Labels: c: new feature,package,c: proposal,P3,p: go_router,team-go_router,triaged-go_router

### Use case

Our application can create a bottom navigation bar dynamically so we need to declare all possible routes in `GoRouter` config. And so the sequence of navigation destinations inside the `NavigationBar` can be diffrent then one declrared in `branches` of `StatefulShellRoute`. But the method `goBranch` allows to switch to route by `index` of initially declared routes.

Below the sample where 4 routes are declared in router config but the sequence is not `1,2,3,4` but `1,2,4`. So when user taps on `page4` he is redirected to `/path3` what is wrong for our business logic. I tried to workaround using the `context.go` method but now I lost a stateful functionality.

<details>
<summary>Sampe</summary>

```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 branch1 = GlobalKey<NavigatorState>();
final branch2 = GlobalKey<NavigatorState>();
final branch3 = GlobalKey<NavigatorState>();
final branch4 = GlobalKey<NavigatorState>();

final _router = GoRouter(
  debugLogDiagnostics: true,
  initialLocation: '/page1',
  routes: [
    StatefulShellRoute.indexedStack(
      branches: [
        StatefulShellBranch(
          navigatorKey: branch1,
          routes: [
            GoRoute(
              path: '/page1',
              builder: (context, state) => const Text('page 1'),
            ),
          ],
        ),
        StatefulShellBranch(
          navigatorKey: branch2,
          routes: [
            GoRoute(
              path: '/page2',
              builder: (context, state) => const Text('page 2'),
            ),
          ],
        ),
        StatefulShellBranch(
          navigatorKey: branch3,
          routes: [
            GoRoute(
              path: '/page3',
              builder: (context, state) => const Text('page 3'),
            ),
          ],
        ),
        StatefulShellBranch(
          navigatorKey: branch4,
          routes: [
            GoRoute(
              path: '/page4',
              builder: (context, state) => const Text('page 4'),
            ),
          ],
        ),
      ],
      builder: (context, state, navigationShell) {
        return Home(child: navigationShell);
      },
    ),
  ],
);

class Home extends StatelessWidget {
  const Home({super.key, required this.child});

  final StatefulNavigationShell child;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: Center(
          child: child,
        ),
      ),
      bottomNavigationBar: NavigationBar(
        destinations: const [
          NavigationDestination(
            icon: Icon(Icons.access_alarm),
            label: 'page1',
          ),
          NavigationDestination(
            icon: Icon(Icons.access_alarm),
            label: 'page2',
          ),
          NavigationDestination(
            icon: Icon(Icons.access_alarm),
            label: 'page4',
          ),
        ],
        selectedIndex: child.currentIndex,
        onDestinationSelected: (index) {
          child.goBranch(index, initialLocation: index == child.currentIndex);
        },
      ),
    );
  }
}
```
</details>

### Proposal

The proposal is to create some method like `goBranchPath`.

```dart
void goBranchPath(String location, {bool initialLocation = false}) {
  // find the required index of the branch which use [location]
  // use default functionaluty
}
```