Implement conditional navigation with the Conditional Navigation Recipe
masterThe Conditional Navigation Recipe provides a pattern for restricting access to specific destinations based on application state (e.g., authentication).
In this pattern, a custom AppBackStack manages the navigation logic. If a user attempts to navigate to a destination that implements the RequiresLogin marker interface while not authenticated, the system automatically redirects them to a Login screen. Once authentication is successful, the system can automatically redirect the user back to their intended destination.