How to access pathParameter directly in Gorouter

26 Views Asked by At

i'm new to the flutter i'm curious how to access pathParameter using gorouter, am i doing wrong or what?

GoRouter initializeRoute(){
  return GoRouter(
    routes: [
      GoRoute(
        path: AppRoute.main,
        name: "main",
        builder: (context, state) => const MainPortofolioView(),
        routes: [
          GoRoute(
            name: "profile",
            path: AppRoute.profile,
            builder: (context, state) => const ProfilePortofolioView(),
          ),
          GoRoute(
            name: "projects",
            path: AppRoute.projects,
            builder: (context, state) => const ProjectPortofolioView(),
            routes: [
              GoRoute(
                name: "project",
                path: AppRoute.project,
                builder: (context, state){
                  final data = state.extra as ProjectInformationTileEntity;
                  return ProjectInformationView(projectID: data.projectID);
                },
              )
            ]
          ),
          GoRoute(
            name: "contact",
            path: AppRoute.contact,
            builder: (context, state) => const ContactPortofolioView(),
          ),
          GoRoute(
            name: "debug",
            path: AppRoute.debug,
            builder: (context,state) => const DebugView()
          )
        ]
      )
    ]
  );
}

so i try to access for example profile route which is "http://localhost:49597/profile", why it's not working? same also on the others This path

0

There are 0 best solutions below