load method

void load({
  1. File? file,
  2. bool? testing,
})

Reads the .env file once.

When the app runs its tests, it also reads .env.testing (next to .env). Its keys win over the keys of .env. A real environment variable still wins over both. testing is isTesting by default.

Implementation

void load({File? file, bool? testing}) {
  if (env.isEmpty) {
    env = _loadEnv(file: file, testing: testing ?? isTesting);
  }
}