14 lines
762 B
Dart
14 lines
762 B
Dart
/// Build-time configuration, passed with `--dart-define` (or `--dart-define-from-file=env.json`).
|
|
/// When the Supabase values are empty the app runs on the bundled demo catalog.
|
|
abstract final class Env {
|
|
static const supabaseUrl = String.fromEnvironment('SUPABASE_URL');
|
|
static const supabasePublishableKey = String.fromEnvironment('SUPABASE_PUBLISHABLE_KEY');
|
|
|
|
/// Public base URL of the audio files. Defaults to the Supabase "audio" storage bucket.
|
|
static const _mediaBaseUrl = String.fromEnvironment('MEDIA_BASE_URL');
|
|
static String get mediaBaseUrl =>
|
|
_mediaBaseUrl.isNotEmpty ? _mediaBaseUrl : '$supabaseUrl/storage/v1/object/public/audio';
|
|
|
|
static bool get hasSupabase => supabaseUrl.isNotEmpty && supabasePublishableKey.isNotEmpty;
|
|
}
|