dotenv 0.1.3-pre copy "dotenv: ^0.1.3-pre" to clipboard
dotenv: ^0.1.3-pre copied to clipboard

outdatedDart 1 only

Load environment variables from a `.env` file.

example/example.dart

import 'dart:io';

import 'package:dotenv/dotenv.dart' as dotenv;

void main() {
  dotenv.load();

  stdout.writeln('read all vars? ${dotenv.isEveryDefined(['foo', 'baz'])}');

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

  dotenv.clean();

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

get env => dotenv.env;
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)

More

Packages that depend on dotenv