env property

Map<String, String> get env

The values of the .env file. The first read loads the file, so a read gives the same answer whether or not something loaded it before. After that it is a plain map read: the file is never read again.

Implementation

Map<String, String> get env {
  if (!_loaded) load();
  return _env;
}
set env (Map<String, String> value)

Sets the values, for tests. It counts as loaded: the next read does not put the .env file on top. Call load on an empty map to read the file again.

Implementation

set env(Map<String, String> value) {
  _env = value;
  _loaded = true;
}