Welcome to the Flutter and Supabase Mobile App Starter Template! This template provides a solid foundation for building cross-platform mobile applications using Flutter and Supabase. This template will save you 24+ hours of development work. You can quickly kickstart your mobile app development process, focusing on creating amazing user experiences without worrying about setting up authentication flows from scratch.
- Clean architecture with the feature-first-project structure where features are separated into 3 modules: data, domain, and presentation.
- State management with BLoC/Cubit
- Dependency injection using GetIt and Injectable
- Navigation with GoRouter
- Dark mode
- Hive as a local database
- Supabase integration
- Authentication flow using login with a magic link
- Change email address
- Settings page with Privacy Policy and Terms of Service links
- Flutter Native Splash Screen
- Flutter Launcher Icons
- Google Fonts
- Create Supabase Project: Visit Supabase and create a new project.
- Enable Email Provider: Navigate to the Authentication page in the Supabase dashboard. In the Configuration tab, enable the Email Provider. In our simple example, we disabled Secure Email Change. This is not our recommendation and we consider enabling it in production would be helpful.
- Configure URL Callbacks: In the URL Configuration section, add the Site URL and Redirect URLs for login and change email address callbacks. Replace testproject with the name of your Supabase project.
Site URL:
io.supabase.testproject
Redirect URLs:
io.supabase.testproject://login-callback/
io.supabase.testproject://change-email/
- Run flutter pub get
- Add Supabase Project URL and Public Anon Key:
- In your main.dart file, locate the _initializeSupabase() method.
- Replace PROJECT_URL and PUBLIC_ANON_KEY with your Supabase project URL and public anon key respectively. You can find these in the API settings tab inside the Project Settings section on Supabase.
- Setup Deeplinking URLs:
- Edit the ios/Runner/Info.plist file: Update CFBundleURLSchemes to match your Site URL.
- Edit the android/app/src/main/AndroidManifest.xml file: Update intent-filter to match the scheme and host of your Site URL and Redirect URLs.
- Open /lib/core/constants/urls.dart and update _baseSupabaseUrl to match your Site URL.