How the pieces connect
Supabase Realtime runs as a server-side process that tails the Postgres write-ahead log (WAL) through logical replication. When a row changes on a table you've enabled for replication, the change is fanned out over a Phoenix-channels WebSocket to every subscribed client. On the Flutter side, supabase_flutter holds one shared RealtimeClient connection; each supabase.channel('name') you create multiplexes over that single socket rather than opening a new connection per subscription. You attach a listener with .onPostgresChanges(event: PostgresChangeEvent.insert, schema: 'public', table: 'orders', callback: ...), then .subscribe(). The callback fires with a PostgresChangePayload carrying newRecord and oldRecord maps. Crucially, you must enable the table for the supabase_realtime publication first (the dashboard's Replication settings, or ALTER PUBLICATION) — without that, no events are emitted no matter how the client subscribes.