environmentConfiguration function
Enum representing the available application environments.
testUsed during local development or automated testing.stagingUsed for pre-production or QA testing.productionUsed in the live, public-facing version of the app.
Implementation
String environmentConfiguration() => '''
enum Environment {
test,
production,
staging,
}
class AppConfig {
final Environment env;
const AppConfig({this.env = Environment.test});
String get baseUrl {
switch (env) {
case Environment.test:
return "api.tfkcodes.com/test"; // Used for local testing
case Environment.staging:
return "api.tfkcodes.com/staging"; // Used for staging/QA
case Environment.production:
return "api.tfkcodes.com"; // Live production environment
}
}
}
''';