flutter - Is this a valid routes config in go_router? - Stack Overflow

admin2025-04-16  3

This is actually a short version of this question (at least these questions are related in meaning).

Is the following routes structure valid? (hint: these are nested ‘routes’ sections)

final _router = GoRouter(
  initialLocation: '/',
  routes: [
    GoRoute(
      path: '/',
      builder: (context, state) => const HomeView(),
      routes: [
        ...
        GoRoute(
          path: 'rapports',
          builder: (context, state) {
            return const RapportListViewMod();
          },
          routes: [
            GoRoute(
                path: '/groupWithExtraParam',
                builder: (context, state) {
                    ...
                },
            ),
          ],
        ),
        ...
      ],
    ),
    ...
  ]
);
转载请注明原文地址:http://anycun.com/QandA/1744767446a87338.html