exists method

bool exists()

Checks if the environment variable exists in the loaded configuration.

Returns true if the key is defined, otherwise false.

Example

final exists = Env<String>('API_KEY').exists();
print('API key exists? $exists');

Implementation

bool exists() => environment.containsProperty(_key);