title: How do I set up navigator using Getx and Auto Route?
body: <p><strong>Problem:</strong>
  I am having trouble setting up navigation using GetX and AutoRoute.</p>
  <p><strong>Code Setup:</strong>
  According to the GetX documentation, if you want to use GetX navigation you have to replace MaterialApp() with GetMaterialApp(). You also set the routes.</p>
  <pre><code>void main() {
    runApp(
      GetMaterialApp(
        initialRoute: '/',
        getPages: [
          GetPage(name: '/', page: () =&gt; MyHomePage()),
          GetPage(name: '/second', page: () =&gt; Second()),
          GetPage(
            name: '/third',
            page: () =&gt; Third(),
            transition: Transition.zoom  
          ),
        ],
      )
    );
  }
  </code></pre>
  <p>The AutoRoute example uses MaterialApp.router() to set up the routerDelegate and routeInformationParser.</p>
  <pre><code>   final _appRouter = AppRouter()  
     ...  
    Widget build(BuildContext context){  
        return MaterialApp.router(  
               routerDelegate: _appRouter.delegate(...initialConfig),  
               routeInformationParser: _appRouter.defaultRouteParser(),  
           ),  
    } 
  </code></pre>
  <p>Here is how I set up the navigation according to Getx and AutoRoute:</p>
  <pre><code>void main() {
   configureDependencies();
   runApp(Portfolio());
  }
  
  class Portfolio extends StatelessWidget {
    final _appRouter = AppRouter.Router();
    @override
    Widget build(BuildContext context) {
    return GetMaterialApp.router(
        routerDelegate: _appRouter.delegate(),
        routeInformationParser: _appRouter.defaultRouteParser(),
        builder: (context, extendedNav) =&gt; Theme(
            data: ComplexReduxTheme.complexReduxLightTheme,
            child: extendedNav ?? Container(color: Colors.red),
           ),
        );
      }
    } 
  </code></pre>
  <p>I am using GetMaterialApp.router which returns a GetMaterialApp. Despite this, I get the error &quot;You are trying to use contextless navigation without a GetMaterialApp or Get.key.&quot;. I have tried setting up the navigator key and setting Get.testMode = true but nothing happens(no error) when I try to navigate to another screen.</p>
  <p><strong>Desired Result:</strong>
  I should be able to navigate to the desired screen via Get.toNamed().</p>
  <p><strong>Current Result:</strong>
  I get the following error from GetX when trying to navigate to another screen using Get.toNamed() : &quot;You are trying to use contextless navigation without
  a GetMaterialApp or Get.key.
  If you are testing your app, you can use:
  [Get.testMode = true], or if you are running your app on
  a physical device or emulator, you must exchange your [MaterialApp]
  for a [GetMaterialApp].&quot;</p>
  <p><strong>AutoRoute Version:</strong> 2.2.0</p>
  <p><strong>Get Version:</strong> 4.1.4</p>