load method

Future<Map<String, String>> load(
  1. String path
)

Loads and parses the .env file at path.

Throws EnvLoadException if the asset cannot be loaded.

Implementation

Future<Map<String, String>> load(String path) async {
  try {
    final raw = await _bundle.loadString(path);
    return _parser.parse(raw);
  } catch (e) {
    throw EnvLoadException(
      'Failed to load env asset at "$path": $e',
    );
  }
}