dotenv 4.2.0 copy "dotenv: ^4.2.0" to clipboard
dotenv: ^4.2.0 copied to clipboard

Load environment variables from a `.env` file.

example/example.dart

import 'dart:io';

import 'package:dotenv/dotenv.dart';

void main() {
  var env = DotEnv(includePlatformEnvironment: true)..load();

  p('read all vars? ${env.isEveryDefined(['foo', 'baz'])}');

  p('foo=${env['foo']}');
  p('baz=${env['baz']}');
  p('your home directory is: ${env['HOME']}');

  env.clear();
  p('cleared!');

  p('env has key foo? ${env.isDefined('foo')}');
  p('env has key baz? ${env.isDefined('baz')}');
  p('your home directory is still: ${env['HOME']}');
}

p(String msg) => stdout.writeln(msg);
131
likes
135
points
54k
downloads

Publisher

verified publisherpracticalflutter.com

Weekly Downloads

Load environment variables from a `.env` file.

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

MIT (license)

Dependencies

args, meta

More

Packages that depend on dotenv