loadMap static method

void loadMap(
  1. Map<String, String> map, {
  2. bool overwrite = true,
})

Populates environment variables directly from a map of key-value pairs.

If overwrite is true (the default), existing keys are overwritten.

Example

BloomEnv.loadMap({'PORT': '8080', 'HOST': '0.0.0.0'});

Implementation

static void loadMap(Map<String, String> map, {bool overwrite = true}) {
  map.forEach((k, v) {
    if (overwrite || !_env.containsKey(k)) {
      _env[k] = v;
    }
  });
}