DotEnv class

Constructors

DotEnv()

Properties

env Map<String, String>
A copy of variables loaded at runtime from a file + any entries from mergeWith when loaded.
no setter
hashCode int
The hash code for this object.
no setterinherited
isInitialized bool
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clean() → void
Clear env
get(String name, {String? fallback}) String
isEveryDefined(Iterable<String> vars) bool
True if all supplied variables have nonempty value; false otherwise. Differs from containsKey by excluding null values. Note load should be called first.
load({String fileName = '.env', Parser parser = const Parser(), Map<String, String> mergeWith = const {}, bool isOptional = false}) Future<void>
Loads environment variables from the env file into a map Merge with any entries defined in mergeWith
maybeGet(String name, {String? fallback}) String?
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
testLoad({String fileInput = '', Parser parser = const Parser(), Map<String, String> mergeWith = const {}}) → void
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited