I am creating a Flutter application where some screens may be displayed to anonymous users, while other screens require the user to be logged in.
For authenticated screens, they should automatically go to the (click) login screen if the user does not log in. A user session may expire at any time, and if the user views one of these authentication screens, then the login screen should be displayed immediately at that time.
In Flutter, how can I achieve this concept of authenticated screens that automatically move to / from the login screen when the user is not authenticated?
Mattc source
share