Repository: flutter
Issue: [go_router] routeInformationProvider.value.uri is incorrect after goBranch switching
Labels: package,has reproducible steps,P2,p: go_router,team-go_router,triaged-go_router,found in release: 3.19,found in release: 3.22

### Steps to reproduce

Given a Router with StatefulBranches when observing for `router.routeInformationProvider.value.uri.path` you notice that it doesn't properly update to the shown Route when swiching branches with `navigationShell.goBranch` but always shows the Branches Root URI.

### Expected results

After a switch with `navigationShell.goBranch` `router.routeInformationProvider.value.uri` should have the currently _shown_ URI as a value

### Actual results

after goBranch `router.routeInformationProvider.value.uri` always points to the Branch Root URI regardless of what is shown. 

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    final router = GoRouter(
      initialLocation: '/',
      debugLogDiagnostics: true,
      routes: [
        GoRoute(
          name: 'root',
          path: '/',
          pageBuilder: (context, state) {
            return NoTransitionPage(
              key: state.pageKey,
              child: Root(),
            );
          },
        ),
        StatefulShellRoute.indexedStack(
          builder: (
            BuildContext context,
            GoRouterState state,
            StatefulNavigationShell navigationShell,
          ) {
            return HomeShell(navigationShell: navigationShell);
          },
          branches: [
            StatefulShellBranch(
              routes: [
                GoRoute(
                  name: 'a',
                  path: '/a',
                  pageBuilder: (context, state) {
                    return NoTransitionPage(
                      key: state.pageKey,
                      child: PageA(),
                    );
                  },
                ),
                GoRoute(
                  name: 'ab',
                  path: '/a/b',
                  pageBuilder: (context, state) {
                    return NoTransitionPage(
                      key: state.pageKey,
                      child: PageAB(),
                    );
                  },
                ),
              ],
            ),
            StatefulShellBranch(
              routes: [
                GoRoute(
                  name: 'b',
                  path: '/b',
                  pageBuilder: (context, state) {
                    return NoTransitionPage(
                      key: state.pageKey,
                      child: PageB(),
                    );
                  },
                ),
                GoRoute(
                  name: 'bc',
                  path: '/b/c',
                  pageBuilder: (context, state) {
                    return NoTransitionPage(
                      key: state.pageKey,
                      child: PageBC(),
                    );
                  },
                ),
              ],
            ),
          ],
        ),
      ],
    );

    router.routerDelegate.addListener(() {
      final newRoute = router.routeInformationProvider.value.uri.path;
      print('Routing updated: $newRoute');
    });

    return MaterialApp.router(
      routerConfig: router,
      title: 'GoRouter SubShell Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
    );
  }
}

class HomeShell extends StatelessWidget {
  final StatefulNavigationShell navigationShell;

  const HomeShell({required this.navigationShell});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: navigationShell,
      bottomNavigationBar: BottomAppBar(
        child: Row(
          children: [
            OutlinedButton(
              child: Text('A'),
              onPressed: () => navigationShell.goBranch(
                0,
                initialLocation: navigationShell.currentIndex == 0,
              ),
            ),
            OutlinedButton(
              child: Text('B'),
              onPressed: () => navigationShell.goBranch(
                1,
                initialLocation: navigationShell.currentIndex == 1,
              ),
            ),
          ],
        ),
      ),
    );
  }
}

class PageA extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return InkWell(
        child: Center(child: Text('A')), onTap: () => context.push('/a/b'));
  }
}

class Root extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Column(children: [
      OutlinedButton(child: Text('A'), onPressed: () => context.push('/a')),
      OutlinedButton(child: Text('B'), onPressed: () => context.push('/b')),
    ]);
  }
}

class PageAB extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return InkWell(
        child: Center(child: Text('AB')), onTap: () => context.push('/a/b'));
  }
}

class PageB extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return InkWell(
        child: Center(child: Text('B')), onTap: () => context.push('/b/c'));
  }
}

class PageBC extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return InkWell(
        child: Center(child: Text('BC')), onTap: () => context.push('/b/c'));
  }
}

```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

This is a https://dartpad.dev run of the example code given above.

Notice how the _shown_ route does not match the printed "currentRoute":


https://github.com/flutter/flutter/assets/40496/0fd11782-8d2b-463e-aafd-6239f0faf2eb



</details>


### Logs

_No response_

### Flutter Doctor output

<details open><summary>Doctor output</summary>

Using dartpad.dev to reproduce.

</details>