env_provider 0.2.0 copy "env_provider: ^0.2.0" to clipboard
env_provider: ^0.2.0 copied to clipboard

Env Provider is an all in one utility for interacting with the environment and will never throw and exception.

Env Provider #

Env Provider is an all in one utility for interacting with the environment and will never throw and exception.

Usage #

Platform Directories #

Env Provider is safe super-set of path_provider. As such, all methods of path_provider can be accessed from Env. e.g

Result<Directory, DirectoryRetrievalError> docsDir = await Env.getApplicationDocumentsDirectory();

Get Current Directory #

String currentDir = Env.currentDirectory();

Get the Executable Path #

String exePath = Env.currentExe();

Get an Environment Variable #

String? variable = Env.variable('HOME');

Join Paths #

String path = Env.joinPaths(['/usr/local/bin', '/usr/bin', '/bin']);
print(path); // '/usr/local/bin:/usr/bin:/bin'

List All Environment Variables #

for (var (variable, value) in Env.variables()) {
  print('$variable: $value');
}
1
likes
150
points
37
downloads

Publisher

unverified uploader

Weekly Downloads

Env Provider is an all in one utility for interacting with the environment and will never throw and exception.

Repository (GitHub)

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter, path_provider, rust_core

More

Packages that depend on env_provider