-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ (flutter-web-deploy.yml): downgrade Flutter version to 3.24.5 for c…
…ompatibility 🔧 (supabase_config.dart): switch from dotenv to environment variables for Supabase configuration 📝 (environment_config.dart): remove dotenv loading and use environment variables for configuration 🌐 (index.html): add language attribute and improve meta tags for better SEO 📝 (index.html): update title and description for clarity and branding 💡 (index.html): add loading message and error handling for better user experience 📝 (manifest.json): update app name and description for consistency and branding
- Loading branch information
1 parent
d51d47c
commit df617e4
Showing
6 changed files
with
98 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ jobs: | |
- name: Setup Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: '3.27.1' | ||
flutter-version: '3.24.5' | ||
channel: 'stable' | ||
|
||
- name: Verify Flutter and Dart versions | ||
|
@@ -55,6 +55,12 @@ jobs: | |
run: flutter build web --base-href="/chromaniac/" | ||
env: | ||
FLUTTER_WEB_CANVASKIT_URL: https://unpkg.com/[email protected]/bin/ | ||
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | ||
SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | ||
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }} | ||
OCO_EMOJI: 'true' | ||
OCO_MODEL: 'gpt-4o-mini' | ||
OCO_LANGUAGE: 'en' | ||
|
||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
import 'package:flutter_dotenv/flutter_dotenv.dart'; | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:chromaniac/utils/logger/app_logger.dart'; | ||
|
||
class EnvironmentConfig { | ||
static Future<void> initialize() async { | ||
try { | ||
AppLogger.d('Attempting to load .env file...'); | ||
const envFile = ".env"; | ||
await dotenv.load(fileName: envFile); | ||
AppLogger.i('Successfully loaded .env file'); | ||
AppLogger.d('Initializing environment configuration'); | ||
// No need to load .env file | ||
AppLogger.i('Environment configuration initialized'); | ||
} catch (e) { | ||
AppLogger.e('Critical error loading .env file: $e'); | ||
// Optionally, you can rethrow the error to prevent app startup | ||
// rethrow; | ||
AppLogger.e('Error during environment configuration: $e'); | ||
} | ||
} | ||
|
||
static String get openRouterApiKey { | ||
final key = dotenv.env['OPENROUTER_API_KEY']; | ||
if (key == null || key.isEmpty) { | ||
AppLogger.w('OPENROUTER_API_KEY not found in environment variables'); | ||
// Use environment variable for web, fallback for other platforms | ||
const key = String.fromEnvironment('OPENROUTER_API_KEY', | ||
defaultValue: 'default_key_if_not_set'); | ||
|
||
if (key.isEmpty) { | ||
AppLogger.w('OPENROUTER_API_KEY not found'); | ||
return ''; | ||
} | ||
return key; | ||
} | ||
|
||
static String get emojiSetting { | ||
return dotenv.env['OCO_EMOJI'] ?? 'true'; | ||
return const String.fromEnvironment('OCO_EMOJI', defaultValue: 'true'); | ||
} | ||
|
||
static String get languageSetting { | ||
return dotenv.env['OCO_LANGUAGE'] ?? 'en'; | ||
return const String.fromEnvironment('OCO_LANGUAGE', defaultValue: 'en'); | ||
} | ||
|
||
static String get modelSetting { | ||
return dotenv.env['OCO_MODEL'] ?? 'gpt-4o-mini'; | ||
return const String.fromEnvironment('OCO_MODEL', defaultValue: 'gpt-4o-mini'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters