EnvConfig<E extends Enum> class
Pairs a user-defined enum value with the asset path of its .env file.
EnvConfig is an optional convenience type. Env.init (and
EnvManager.init) accept a plain Map<E, String> — you do not need
EnvConfig for typical usage. It is provided for teams that prefer to
declare environment descriptors in a centralised list:
const configs = [
EnvConfig(env: Environment.dev,
assetPath: 'assets/env/.env.dev'),
EnvConfig(env: Environment.production,
assetPath: 'assets/env/.env.production'),
];
await Env.init<Environment>(
defaultEnv: Environment.production,
configs: Map.fromEntries(
configs.map((c) => MapEntry(c.env, c.assetPath)),
),
);
Constructors
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited