File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,21 +17,16 @@ Future<void> main() async {
1717 late String supabaseApiKey;
1818
1919 // Load environment variables
20- if (kIsWeb) {
21- // For web build, load from 'dotenv' file in root
22- await dotenv.load (fileName: 'dotenv' );
23- supabaseUrl = dotenv.env['SUPABASE_URL' ] ?? '' ;
24- supabaseApiKey = dotenv.env['SUPABASE_KEY' ] ?? '' ;
25- } else {
26- // For local dev, load from '.env' file
20+ if (kIsWeb || ! kIsWeb) {
21+ // For web and local dev, load from .env file
2722 await dotenv.load (fileName: '.env' );
2823 supabaseUrl = dotenv.env['SUPABASE_URL' ] ?? '' ;
2924 supabaseApiKey = dotenv.env['SUPABASE_KEY' ] ?? '' ;
3025 }
3126
3227 // Validate environment variables
3328 if (supabaseUrl.isEmpty || supabaseApiKey.isEmpty) {
34- throw Exception ('SUPABASE_URL and SUPABASE_KEY must be provided in the environment file' );
29+ throw Exception ('SUPABASE_URL and SUPABASE_KEY must be provided in .env file' );
3530 }
3631
3732 final instance = await Supabase .initialize (
You can’t perform that action at this time.
0 commit comments