28 lines
804 B
Dart
28 lines
804 B
Dart
enum Environment { development, uat, production }
|
|
|
|
class AppEnvironment {
|
|
static Environment _currentEnvironment = Environment.development;
|
|
|
|
static Environment get current => _currentEnvironment;
|
|
|
|
static void setEnvironment(Environment environment) {
|
|
_currentEnvironment = environment;
|
|
}
|
|
|
|
static bool get isDevelopment =>
|
|
_currentEnvironment == Environment.development;
|
|
static bool get isUAT => _currentEnvironment == Environment.uat;
|
|
static bool get isProduction => _currentEnvironment == Environment.production;
|
|
|
|
static String get environmentName {
|
|
switch (_currentEnvironment) {
|
|
case Environment.development:
|
|
return 'Development';
|
|
case Environment.uat:
|
|
return 'UAT';
|
|
case Environment.production:
|
|
return 'Production';
|
|
}
|
|
}
|
|
}
|