Supabase Email Authentication in Flutter: The Complete Guide
Flutter Supabase email authentication tutorial: sign-up, login, email confirmation deep links, session persistence, and password reset.
Adding login and sign-up to a Flutter app used to mean wiring up Firebase, writing platform-specific config, and hoping the token refresh logic holds. Supabase Auth gives you the same result with a Postgres database you actually own — and the supabase_flutter package makes the client side almost boring in the best way. In this guide you'll build a complete email authentication flow: sign-up, login, email confirmation, session persistence across restarts, sign-out, and password reset. Every snippet below is written against supabase_flutter v2 (stable) and Flutter 3.47 / Dart 3.13 . (Supabase's v3 SDK was in developer preview as of September 2026 with breaking auth changes — stick with v2 for production apps.) What you'll build Email + password sign-up with proper error handling Login screen that survives wrong-password attempts gracefully An auth gate that routes users to home or login automatically Email confirmation handling (the step most tutorials skip) Password reset via email link Prerequisites Flutter SDK installed (3.x stable) A free Supabase project at supabase.com — you'll need the Project URL and anon (publishable) key from Project Settings → API Security note: the anon key is safe to ship in your app — it's rate-limited and governed by Row Level Security. Never ship the service_role key in a client app; it bypasses every RLS policy. Step 1 — Add the dependency # pubspec.yaml dependencies: flutter: sdk: flutter supabase_flutter: ^2.0.0 Then run flutter pub get . Step 2 — Initialize Supabase in main() Initialize once, before runApp . The client persists the session automatically, so returning users stay logged in across restarts. import 'package:flutter/material.dart'; import 'package:supabase_flutter/supabase_flutter.dart'; Future<void> main() async {…