Skip to content

Commit 704c21a

Browse files
committed
feat: introduce app configuration
- Add AppConfig class - Define environment variables - Add factory constructors
1 parent b05ba8a commit 704c21a

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

lib/app/config/app_config.dart

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import 'package:ht_main/app/config/app_environment.dart';
2+
3+
class AppConfig {
4+
const AppConfig({
5+
required this.environment,
6+
required this.baseUrl,
7+
// Add other environment-specific configs here (e.g., analytics keys)
8+
});
9+
10+
final AppEnvironment environment;
11+
final String baseUrl;
12+
13+
// Factory constructors for different environments
14+
factory AppConfig.production() => const AppConfig(
15+
environment: AppEnvironment.production,
16+
baseUrl: 'http://api.yourproductiondomain.com', // Replace with actual production URL
17+
);
18+
19+
factory AppConfig.developmentInMemory() => const AppConfig(
20+
environment: AppEnvironment.developmentInMemory,
21+
baseUrl: 'http://localhost:8080', // Base URL still needed for Auth API client, even if data is in-memory
22+
);
23+
24+
factory AppConfig.developmentApi() => const AppConfig( // New: For local Dart Frog API
25+
environment: AppEnvironment.developmentApi,
26+
baseUrl: 'http://localhost:8080', // Default Dart Frog local URL
27+
);
28+
}

0 commit comments

Comments
 (0)