79404866

Date: 2025-02-01 11:16:18
Score: 1
Natty:
Report link

if im put my route in onPressed they redirect me to '/home' in my ShellRoute (how they work, why they dont work like previous, idk.) its work thats all i need now. the part

onPressed: () {
            GoRouter.of(context).go('/home');
            //_onNextPressed();
          },

the Main.dart :

GoRouter router = GoRouter(
  initialLocation: isLanguageSet
      ? '/home'
      : '/firstPage',
  routes: [
    GoRoute(
      path: '/firstPage',
      builder: (context, state) => FirstPage(),
    ),
    ShellRoute(
      navigatorKey: GlobalKey<NavigatorState>(),
      builder: (context, state, child) {
        debugPrint("Building ShellRoute with path: ${state.uri}");
        int index = getIndexFromPath(state.uri.path);
        return CurveBar(initialIndex: index);
      },
      routes: [
        GoRoute(
          path: '/home',
          builder: (context, state) => HomePage(),
        ),
Reasons:
  • Blacklisted phrase (0.5): i need
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: LordeW