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).
CupertinoApp doesn’t have a
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?
navigatorKey has been added to the
Answered By – enyo
Answer Checked By – Dawn Plyler (FlutterFixes Volunteer)