2023-05-21 10:53:59 +00:00
|
|
|
// lib/env/env.dart
|
|
|
|
import 'package:envied/envied.dart';
|
|
|
|
|
|
|
|
part 'env.g.dart';
|
|
|
|
|
|
|
|
@Envied(path: '.env')
|
|
|
|
abstract class Env {
|
|
|
|
@EnviedField(
|
|
|
|
obfuscate: true,
|
|
|
|
varName: 'SUPABASE_URL',
|
|
|
|
defaultValue: '',
|
|
|
|
)
|
2023-05-28 04:09:39 +00:00
|
|
|
static final String supabaseUrl = _Env.supabaseUrl;
|
2023-05-21 10:53:59 +00:00
|
|
|
@EnviedField(
|
|
|
|
obfuscate: true,
|
|
|
|
varName: 'SUPABASE_ANON_KEY',
|
|
|
|
defaultValue: '',
|
|
|
|
)
|
2023-05-28 04:09:39 +00:00
|
|
|
static final String supabaseAnonKey = _Env.supabaseAnonKey;
|
2023-05-21 10:53:59 +00:00
|
|
|
@EnviedField(
|
|
|
|
obfuscate: true,
|
|
|
|
varName: 'SUPABASE_KEY',
|
|
|
|
defaultValue: '',
|
|
|
|
)
|
2023-05-28 04:09:39 +00:00
|
|
|
static final String supabaseKey = _Env.supabaseKey;
|
2023-05-21 10:53:59 +00:00
|
|
|
@EnviedField(
|
|
|
|
obfuscate: true,
|
|
|
|
varName: 'SUPABASE_JWT_SECRET',
|
|
|
|
defaultValue: '',
|
|
|
|
)
|
2023-05-28 04:09:39 +00:00
|
|
|
static final String supabaseJwtSecret = _Env.supabaseJwtSecret;
|
2023-05-23 15:55:21 +00:00
|
|
|
|
|
|
|
@EnviedField(
|
|
|
|
obfuscate: true,
|
|
|
|
varName: 'SUPABASE_COLLAB_TABLE',
|
|
|
|
defaultValue: '',
|
|
|
|
)
|
2023-05-28 04:09:39 +00:00
|
|
|
static final String supabaseCollabTable = _Env.supabaseCollabTable;
|
2023-05-21 10:53:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool get isSupabaseEnable =>
|
|
|
|
Env.supabaseUrl.isNotEmpty &&
|
|
|
|
Env.supabaseAnonKey.isNotEmpty &&
|
|
|
|
Env.supabaseKey.isNotEmpty &&
|
|
|
|
Env.supabaseJwtSecret.isNotEmpty;
|