Files
mih-project/Frontend/patient_manager/lib/env/env.dart
2024-07-18 09:47:09 +02:00

41 lines
903 B
Dart

enum Enviroment { dev, prod }
//
abstract class AppEnviroment {
static late String baseApiUrl;
static late String baseFileUrl;
static late Enviroment _enviroment;
static Enviroment get enviroment => _enviroment;
static setupEnv(Enviroment env) {
_enviroment = env;
switch (env) {
case Enviroment.dev:
{
baseApiUrl = "http://localhost:8080";
baseFileUrl = "http://localhost:9000";
break;
}
case Enviroment.prod:
{
baseApiUrl = "http://mzansi-innovation-hub.co.za/api";
baseFileUrl = "http://mzansi-innovation-hub.co.za:9000";
break;
}
}
}
static String getEnv() {
//_enviroment = env;
switch (_enviroment) {
case Enviroment.dev:
{
return "Dev";
}
case Enviroment.prod:
{
return "Prod";
}
}
}
}