Env.fromJson constructor

Env.fromJson(
  1. Map json
)

Implementation

factory Env.fromJson(Map json) {
  return switch (json) {
    {'value': final String value} => EnvValue(value),
    {'fromEnvVar': final String name} => EnvVar(name),
    _ => throw FormatException('Invalid env value: $json'),
  };
}