Flutter Starter
A Flutter user management app with magic links, profiles, and avatar uploads
Start from the Supabase Flutter user management example. It includes a Flutter app, the Supabase Flutter SDK, account screens, and local database migrations.
Installation
Create the app
Install the Flutter SDK, then copy the example with a sparse Git checkout:
git clone --depth 1 --filter=blob:none --sparse https://github.com/supabase/supabase.git my-flutter-app
cd my-flutter-app
git sparse-checkout set examples/user-management/flutter-user-management
cd examples/user-management/flutter-user-managementThis checks out the complete Flutter project, including its Android, iOS, and web configuration. Flutter uses the example's Dart widgets and SDK dependencies directly.
Install dependencies
flutter pub get
cp .env.example .envConfigure Supabase
Install Docker and the Supabase CLI, then start the example's database and migrations:
supabase startFill in .env with the local API URL and publishable key printed by the CLI:
SUPABASE_URL=your-local-api-url
SUPABASE_PUBLISHABLE_KEY=your-publishable-keyUpdate the initialization in lib/main.dart to read the same variable name as .env.example:
await Supabase.initialize(
url: dotenv.env['SUPABASE_URL']!,
anonKey: dotenv.env['SUPABASE_PUBLISHABLE_KEY']!,
);The SDK's anonKey argument accepts a publishable key. The example's original SUPABASE_ANON_KEY lookup must match the name you use in .env.
Run the app
Start with the web target to use the local Supabase instance:
flutter run -d web-server --web-hostname localhost --web-port 3000Open the app, request a magic link, and open the local email inbox printed by the Supabase CLI. Sign in, edit your profile, and upload an avatar.
For Android or iOS, run flutter run and configure mobile deep links for io.supabase.flutterquickstart://login-callback/. Use a Supabase URL reachable from your simulator or device.
Use a hosted project
Follow the Flutter user management tutorial to set up the profile table, Storage policies, and authentication URLs in your Supabase project. Replace the local values in .env with that project's URL and publishable key.