DotEnv class
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 setter inherited
isInitialized
→ bool
no setter
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
Methods
clean ()
→ void
Clear env
get (String name , {String ? fallback })
→ String
getBool (String name , {bool ? fallback })
→ bool
Load the enviroment variable value as a bool
getDouble (String name , {double ? fallback })
→ double
Load the enviroment variable value as a double
getInt (String name , {int ? fallback })
→ int
Load the enviroment variable value as an int
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