dotenv 0.1.3+2 copy "dotenv: ^0.1.3+2" to clipboard
dotenv: ^0.1.3+2 copied to clipboard

outdatedDart 1 only

Load environment variables from a `.env` file.

example/example.dart

import 'dart:io';

import 'package:dotenv/dotenv.dart' show load, clean, isEveryDefined, env;

void main() {
  load();

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

  _p('value of foo is ${env['foo']}');
  _p('value of baz is ${env['baz']}');
  _p('your home directory is: ${env['HOME']}');

  clean();

  _p('cleaned!');
  _p('env has key foo? ${env.containsKey('foo')}');
  _p('env has key baz? ${env.containsKey('baz')}');
  _p('your home directory is still: ${env['HOME']}');
}

_p(msg) => stdout.writeln(msg);
113
likes
0
pub points
96%
popularity

Publisher

verified publisherpracticalflutter.com

Load environment variables from a `.env` file.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

args

More

Packages that depend on dotenv