How to Navigate to Different Home Pages Based on App State in FlutterFlow without Crashing

Actions & Logic

Hello FlutterFlow Community,

I'm experiencing issues with navigating to different home pages based on a persisted app state boolean in my FlutterFlow application. Here’s a brief overview of my setup and the problems I'm encountering:

Setup:

  1. Two Home Pages: One for clients and one for tattoo artists.

  2. App State: I have a persisted boolean (homePro) that determines which home page to navigate to.

  3. Login Flow: The initial page is a splash screen that checks the login state and navigates accordingly.

  4. Screenshots:

    • First two images show the two different home pages (clients and tattoo artists).

    • Third image shows the initial setup where the login page leads directly to the home page.

    • Fourth image shows the flow of actions from the splash screen, including a conditional check for navigation.

Issue:

Whenever I try to implement a "wait" screen to check the homePro boolean in my persisted app state and direct users to the appropriate home page, I encounter crashes or bugs during login, account creation, or when a user is already logged in.

I have already attempted to use a "wait" screen to handle this logic, but it leads to instability.

What have you tried so far?

What I Have Tried:

  1. Adding a "wait" screen to handle the check for homePro and then navigate to the appropriate home page.

  2. Ensuring that the app state is correctly persisted and accessible during the splash screen's logic flow.

Request:

I need guidance on how to correctly navigate to different home pages based on the boolean homePro in my persisted app state without causing crashes or bugs. Any suggestions on structuring this logic or alternative approaches in FlutterFlow would be highly appreciated.

Thank you for your assistance!

Did you check FlutterFlow's Documentation for this topic?
Yes
3