voo_config library
Build-time configuration code generation for Flutter.
This package generates typed configuration classes from .env or .config
files at build time. Use this for non-sensitive configuration values only.
Security Warning
DO NOT use this package for secrets!
Any value embedded in your app binary can be extracted. This includes:
- API keys
- Database credentials
- JWT signing keys
- Private tokens
For secrets, use the voo_secrets package which fetches them securely
at runtime from your backend.
Usage
import 'package:voo_config/voo_config.dart';
@VooConfig(path: '.env')
abstract class AppConfig {
@ConfigField(name: 'API_URL')
static const String apiUrl = '';
@ConfigField(name: 'DEBUG_MODE', type: ConfigType.bool)
static const bool debugMode = false;
}
Then run: dart run build_runner build
Classes
- ConfigField
- Annotation for individual configuration fields.
- VooConfig
- Annotation for classes that should have configuration generated.
Enums
- ConfigType
- The type of a configuration value.