Flutter - Start app with different routes depending on login state
问题 I'm searching for a way to show a different screens on app startup depending on login state. For example, I have the following routes defined: /home /login /settings Naturally, I would check if the user has already logged in within the main() method and then set the initialRoute of my MaterialApp to either /login or /home. After successful login, I can call Navigator.pushReplacement to navigate to /home and the login screen is removed from the stack. Unfortunately, I always have to either