EnvxBuilder class
Loads ordered sources into immutable values or a validated application model.
Builders are reusable. Each completed build is independent; concurrent builds on the same source list share source loading. Binding and validation run separately for each caller. Adding a source affects subsequent builds.
- Available extensions
Constructors
- EnvxBuilder()
- Creates an empty builder; add sources in increasing precedence order.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addDotEnvFile(
String path, {bool optional = false, String prefix = '', String separator = '__'}) → EnvxBuilder -
Available on EnvxBuilder, provided by the EnvxIoBuilder extension
Adds a dotenv file, preserving strings until typed access or binding. -
addEnvironmentVariables(
{String prefix = '', String separator = '__', Map< String, String> ? environment}) → EnvxBuilder -
Available on EnvxBuilder, provided by the EnvxIoBuilder extension
Adds native process values; use a prefix to limit included variables. -
addJsonFile(
String path, {bool optional = false}) → EnvxBuilder -
Available on EnvxBuilder, provided by the EnvxIoBuilder extension
Adds a UTF-8 JSON-object file; optional means missing files only. -
addMemory(
Map< String, Object?> values) → EnvxBuilder - Appends immutable in-memory defaults or overrides.
-
addSource(
ConfigSource source) → EnvxBuilder -
Appends
source, giving it precedence over previously registered sources. -
build<
T> (T bind(Map< String, Object?> values), {void validate(T value)?}) → Future<T> - Loads and binds a model, then validates it before returning.
-
buildValues(
) → Future< ConfigValues> - Loads immutable values with primitive and section getters.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited