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(),
),