dotenv_plus library

Classes

Config
Core configuration class that loads and manages configuration values from multiple sources.
ConfigBuilder
A builder class that allows registering ConfigFactory functions for specific keys, which can then be used to create mapped config objects.
ConfigContext
The context passed to ConfigFactory functions, allowing them to access the current config section and other mapped configs.
ConfigSource
Core configuration class that loads and manages configuration values from multiple sources.
Converter
A converter class that provides methods to convert string values to their appropriate types (null, boolean, number, or string).
DotEnvParser
A simple parser for .env files that supports basic key-value pairs, comments, and optional interpolation.
EnvFile
A ConfigSource that loads configuration from a .env file. The .env file should contain key-value pairs in the format KEY=VALUE, with optional comments starting with #. Example .env file:
JsonFile
A ConfigSource that loads configuration from a JSON file. The JSON file should contain a flat key-value structure, where values can be strings, numbers, booleans, or null. Example JSON file:
SystemEnv
A ConfigSource that loads configuration from the system environment variables.

Typedefs

ConfigExtension = void Function(ConfigBuilder builder)
ConfigFactory<T> = T Function(ConfigContext context)
A type definition for a function that takes a ConfigContext and returns an instance of type T.
ConfigValidationSchema = Map<String, dynamic> Function(Map<String, dynamic> values)
Core configuration class that loads and manages configuration values from multiple sources.