Files
mobile-app/lib/config/app_config.dart

17 lines
383 B
Dart

import 'package:flutter_dotenv/flutter_dotenv.dart';
enum Flavor { local, demo, dev, prod }
class AppConfig {
static late Flavor flavor;
static String get envFileName => '.env.${flavor.name}';
static Future<void> init(Flavor f) async {
flavor = f;
await dotenv.load(fileName: envFileName);
}
static String get apiBaseUrl => dotenv.env['API_BASE_URL'] ?? '';
}