Created
January 2, 2025 22:17
-
-
Save VB10/01a29021383ef6b2019e87707865fa1d to your computer and use it in GitHub Desktop.
Environment usage for general
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:envied/envied.dart'; | |
import 'package:gen/src/environment/app_configuration.dart'; | |
part 'prod_env.g.dart'; | |
@Envied(path: 'assets/env/.prod.env', obfuscate: true) | |
/// Production environment variables | |
final class ProdEnv implements AppConfiguration { | |
@EnviedField(varName: 'BASE_URL') | |
static final String _baseUrl = _ProdEnv._baseUrl; | |
@EnviedField(varName: 'API_KEY') | |
static final String _apiKey = _ProdEnv._apiKey; | |
@override | |
String get apiKey => _apiKey; | |
@override | |
String get baseUrl => _baseUrl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment