Skip to content

QlevarRouter and GetX #142

Answered by jessicamrbr
jessicamrbr asked this question in Q&A
Discussion options

You must be logged in to vote

I found a way. I used GetRoot instead of GetMaterialApp.

QRouterDelegate qRouterDelegate = QRouterDelegate(AppRoutes.routes);

GetRoot(
  config: ConfigData(
    navigatorKey: qRouterDelegate.key,
...
  ),
  child: Builder(
    builder: (context) {
      final controller = GetRoot.of(context);
      return MaterialApp.router(
...
        key: controller.config.unikey,
        routerDelegate: qRouterDelegate,
        routeInformationParser: const QRouteInformationParser(),
        builder: (BuildContext getRootCtx, Widget? widget) {
...

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jessicamrbr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant