How the pieces connect
The Flutter app talks to Supabase through the supabase_flutter package, which wraps the auto-generated PostgREST API, GoTrue auth, Realtime, and Storage behind one Supabase.instance.client. You initialize it once in main() with your project URL and anon key, then read and write tables with the query builder — supabase.from('bookings').select() compiles to a PostgREST request, not raw SQL from the device. The anon key is public by design; it carries no privileges of its own. What a request can actually touch is decided server-side by Row-Level Security policies that read auth.uid() from the verified JWT. So the real authorization boundary lives in Postgres, not in Dart. The service-role key, which bypasses RLS, must never ship inside the Flutter binary — keep it in Edge Functions or your own server only.