Flutter Tutorial: building a Flutter chat app
A real-time single-room chat app can be built with Flutter on the frontend and Supabase as the entire backend, using the supabase_flutter SDK instead of a custom API. The walkthrough creates profiles and messages tables in Postgres with username validation constraints, adds the messages table to the supabase_realtime publication for live updates, initializes the Supabase client, routes users via a splash page based on auth session, and defines Dart data models plus a registration page. Authentication and row-level security are deferred to a second part.
Related posts
- Flutter Authorization with RLS
Supabase mediumAdeptExtends a basic Flutter real-time chat app into a 1-on-1 chat with authorization enforced by PostgreSQL Row Level Security on Supabase. The schema adds rooms and room_participants tables, a room_id foreign key on messages, and a security-definer plpgsql function create_new_room that returns an existing room for two users or creates one. The client side uses flutter_bloc cubits to stream room participants and each room's latest message via Supabase realtime. Email confirmation is handled through deep links configured in iOS Info.plist, AndroidManifest.xml and the Supabase redirect URL settings.
- Making a Real-Time Chat App with Supabase on Replit
Replit mediumAdeptA real-time public chat app can be built with a Vue 3 and Tailwind CSS frontend on Replit backed by Supabase's hosted Postgres. The walkthrough creates a messages table via SQL, enables replication-based real-time events, and wraps the supabase-js client in a Vue composable. That composable handles paginated message loading by range, INSERT subscriptions for live updates, and inserts for sending. Users are identified only by a random username stored in localStorage, and older messages load when the list is scrolled to the top.
- Supabase Flutter SDK 1.0 Developer Preview
Supabase mediumAdeptSupabase Flutter SDK 1.0 enters developer preview with a focus on developer experience. Auth state persistence and deep link handling now happen automatically on initialization, replacing the removed SupabaseAuthState and SupabaseAuthRequiredState classes. Errors are now thrown instead of returned, since Dart lacks destructuring, and `.execute()` is deprecated so queries resolve directly to data. Deep links now work on macOS and Windows through app_links, Multiplayer realtime support is planned for the stable release, and a new Supabase Auth UI package provides prebuilt email, magic link and social login widgets.
- Create a Figma Clone app with Flutter and Supabase Realtime
Supabase mediumAdeptA collaborative design canvas, a simplified Figma, built by combining Supabase Realtime Broadcast for low-latency client-to-client messaging with Flutter's CustomPainter for low-level canvas rendering. Users can draw circles and rectangles, drag them around, and see each other's cursors live, while canvas state persists to a Postgres table of JSONB objects behind simple RLS policies. The walkthrough covers project setup, a SyncedObject class hierarchy with JSON serialization and hit-testing, and a custom painter that renders cursors and shapes. Auth is skipped and users get random UUIDs.
- Supabase Realtime: Broadcast and Presence Authorization
Supabase mediumAdeptSupabase Realtime now supports authorization for Broadcast and Presence channels using Postgres Row Level Security policies on a managed `realtime.messages` table, where SELECT policies govern receiving and INSERT policies govern sending. Clients opt in with a `private: true` channel config, and policies can reference the channel name via `realtime.topic()` and the extension column. On subscription, the server loads JWT claims into a Postgres transaction with `set_config`, runs rolled-back SELECT/INSERT probes against the table, and caches the resulting per-socket policy map in memory. This adds latency only at connect time, and policies are re-checked on reconnect or token refresh, so token expiry controls how quickly policy changes take effect.