Search code examples
reduxdartflutterflutter-redux

How to navigate in a CupertinoApp


With a MaterialApp you can provide the navigatorKey and use that in your middleware to redirect the user if necessary (as it's done in the flutter redux example).

But CupertinoApp doesn’t have a navigatorKey.

What we are doing now is to add the context to the action so we have access to it in the middleware, and can then user Navigator.of(context), but this seems very wrong.

What is the best way to achieve this?


Solution

  • navigatorKey has been added to the CupertinoApp.