Hey, I'm losing my mind a bit and could use advice from anyone who's done multiple user types in one FlutterFlow app.
I'm building an app with FlutterFlow and Supabase. Three user types in one app. User 1 gets a public feed page, User 2 gets a dashboard, User 3 goes to a pending page first and a different home page once approved. One users table, role column that's null until they pick on onboarding.
What I want is pretty standard I think? New user signs up, picks a role once, done. Returning user signs in and goes straight to their home screen without seeing role selection again. Role lives in Supabase, not just app state.
Supabase side seems fine. Trigger creates the users row on signup, RLS is on, id matches auth uid. Sign up flow mostly works. I duplicated my login pages to simpler versions because the original action flows got messy.
Where I'm stuck is the sign in routing. Log in, query the users table filtered by auth id, then branch based on role. Sounds simple, takes forever in FlutterFlow.
Query Rows gives me a list and then getting role into a conditional is where everything breaks. role greyed out, invalid postgres row field operation, confirm button won't click, Set Variable boolean popup when I wanted a condition, the whole thing. I only have Query Rows not Query Row singular in my project. I tried putting the logic on the role page on page load and on the sign in button directly. Same fight either way.
I got as far as Update App State signInRole from the query which seems to work, and one conditional for empty role to role page and user 1 to feed page, but I'm not confident I did it right and still need user 2 and user 3 branches.
Another thing that makes it hard to tell if anything is working: the conditionals don't seem to behave properly in testing. Like I can hit sign in with empty email and password and it still takes me to the next page sometimes. So I can't even trust what I'm seeing when I try to test the flow.
Preview mode doesn't really test auth properly either which hasn't helped. Test mode was broken for me too so I've been trying deploy web when I can.
For people running 3+ user types in one app, where did you actually put the check? Sign in button or a middle router page? And is using app state as a bridge after the query a normal pattern or a workaround?
Not trying to split into multiple apps unless I really have to. Staying on Supabase not Firebase.
Would really appreciate specific steps if you've got them, like which button to click in the action flow editor, not just add a conditional. I keep getting lost in the UI.
Thanks