Set up Dev and Prod enviroments and updae docker to build prod enviroment

This commit is contained in:
2024-07-11 15:17:34 +02:00
parent 8bf613801d
commit 1c7db86571
26 changed files with 79 additions and 17 deletions

View File

@@ -0,0 +1,36 @@
enum Enviroment { dev, prod }
abstract class AppEnviroment {
static late String baseApiUrl;
static late Enviroment _enviroment;
static Enviroment get enviroment => _enviroment;
static setupEnv(Enviroment env) {
_enviroment = env;
switch (env) {
case Enviroment.dev:
{
baseApiUrl = "http://localhost";
break;
}
case Enviroment.prod:
{
baseApiUrl = "api";
break;
}
}
}
static String getEnv() {
//_enviroment = env;
switch (_enviroment) {
case Enviroment.dev:
{
return "Dev";
}
case Enviroment.prod:
{
return "Prod";
}
}
}
}