I have looked it up, but how can I navigate to the root using the GoRouter package? Currently, I am using context.pop() corresponding to each current path, like this:
context.pop();
context.pop();
context.pop();
Here is how I have defined the GoRouter: [Please provide the GoRouter definition here.
class RouterService {
final router = GoRouter(
initialLocation: '/',
routes: [
GoRoute(
name: 'rootPage',
path: '/',
pageBuilder: (BuildContext context, GoRouterState state) {
return MaterialPage(
key: state.pageKey,
child: RootPage(),
);
},
),
],
);
}