File tree Expand file tree Collapse file tree 4 files changed +7
-17
lines changed
Expand file tree Collapse file tree 4 files changed +7
-17
lines changed Original file line number Diff line number Diff line change 3030
3131 - name : Install dependencies
3232 run : flutter pub get
33-
34- - name : create sample .env file
35- run : touch .env
3633
3734 - name : Build web
3835 run : flutter build web --release --dart-define=SUPABASE_URL=${{ secrets.SUPABASE_URL }} --dart-define=SUPABASE_KEY=${{ secrets.SUPABASE_KEY }}
Original file line number Diff line number Diff line change @@ -45,4 +45,5 @@ app.*.map.json
4545/android /app /profile
4646/android /app /release
4747/dist /
48- dotenv
48+ dotenv
49+ run.sh
Original file line number Diff line number Diff line change @@ -19,18 +19,10 @@ Future<void> main() async {
1919 // Load environment variables
2020 if (kIsWeb) {
2121 // For web, use --dart-define values
22- supabaseUrl =
23- const String .fromEnvironment ('SUPABASE_URL' , defaultValue: '' );
24- supabaseApiKey =
25- const String .fromEnvironment ('SUPABASE_KEY' , defaultValue: '' );
26-
27- if (supabaseUrl == '' && supabaseApiKey == '' ) {
28- await dotenv.load (fileName: '.env' );
29- supabaseUrl = dotenv.env['SUPABASE_URL' ] ?? '' ;
30- supabaseApiKey = dotenv.env['SUPABASE_KEY' ] ?? '' ;
31- }
22+ supabaseUrl = const String .fromEnvironment ('SUPABASE_URL' , defaultValue: '' );
23+ supabaseApiKey = const String .fromEnvironment ('SUPABASE_KEY' , defaultValue: '' );
3224 } else {
33- // For non-web (local dev) , load from .env
25+ // For non-web platforms , load from .env
3426 await dotenv.load (fileName: '.env' );
3527 supabaseUrl = dotenv.env['SUPABASE_URL' ] ?? '' ;
3628 supabaseApiKey = dotenv.env['SUPABASE_KEY' ] ?? '' ;
@@ -88,4 +80,4 @@ class _MyAppState extends State<MyApp> {
8880 home: const SplashScreen (),
8981 );
9082 }
91- }
83+ }
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ flutter:
8585 # To add assets to your application, add an assets section, like this:
8686 assets :
8787 - assets/
88- - .env
88+ # - .env
8989 # - images/a_dot_ham.jpeg
9090
9191 # An image asset can refer to one or more resolution-specific "variants", see
You can’t perform that action at this time.
0 commit comments