envx_io library
Native filesystem and process-environment adapters for envx.
Import envx.dart instead in browser code. No Flutter SDK is required.
Classes
- ConfigSource
- An asynchronous provider of JSON-compatible configuration values.
- ConfigValues
- Immutable configuration with case-sensitive, dot-separated path access.
- DotEnvFileSource
- A native dotenv file with optional prefix filtering and nested keys.
- Environment
- Factory for creating typed or non-typed EnvironmentInstances.
-
EnvironmentInstance<
K, C> - Base environment wrapper used by both typed and non-typed variants.
- EnvxBuilder
- Loads ordered sources into immutable values or a validated application model.
- EnvxConstants
- Constants used by the library. Keep magic strings out of the code.
- JsonFileSource
- A native UTF-8 JSON-object file loaded on demand.
- MemoryConfigSource
- Immutable defaults or explicit overrides available on every platform.
- PlatformEnvironmentSource
- Native process environment strings, optionally filtered and nested.
Extensions
- EnvxIoBuilder on EnvxBuilder
-
Native-only fluent providers. Import
package:envx/envx_io.dart.
Functions
-
aliasesResolver<
E extends Enum> (Map< E, List< aliases, {bool caseInsensitive = true, bool allowEnumName = true, bool strictCollisions = false}) → EnvResolver<String> >E> -
Set
strictCollisions: trueto reject aliases assigned to different values. By default, the last assignment wins for 1.x compatibility. -
nestEnvironmentValues(
Map< String, String> values, {String prefix = '', String separator = '__'}) → Map<String, Object?> - Maps flat environment strings to nested, case-sensitive configuration.
-
parseDotEnv(
String text) → Map< String, String> - Parses dotenv assignments into strings without interpolation or evaluation.
-
parseJsonConfig(
String text) → Map< String, Object?> - Parses a JSON object, rejecting arrays, scalars, and invalid JSON.
-
tokenResolver<
E extends Enum> (Map< String, E> tokens, {bool caseInsensitive = true, bool strictCollisions = false}) → EnvResolver<E> -
Set
strictCollisions: trueto reject conflicting normalized tokens. By default, the last assignment wins for 1.x compatibility.
Typedefs
-
EnvResolver<
K> = K? Function(String input) - Signature for functions that map a raw environment string to a typed key.
Exceptions / Errors
- ConfigBindingException
- A caller's model binder failed.
- ConfigException
- A configuration failure with a safe, value-free diagnostic message.
- ConfigMissingException
- A required path was absent or contained null.
- ConfigParseException
- Configuration text has invalid syntax or a non-object JSON root.
- ConfigSourceException
- A required configuration source could not be read.
- ConfigTypeException
- A configuration value could not be converted to the requested type.
- ConfigValidationException
- Configuration did not satisfy application validation rules.