Env class

Environment access.

Properties

hashCode int
The hash code for this object.
no setterinherited
mode String
Current environment name.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

get(String key, [String defaultValue = '']) String
Get a string with default.
getBool(String key, [bool defaultValue = false]) bool
Get a bool env var.
getInt(String key, [int defaultValue = 0]) int
Get an int env var.
getList(String key, [List<String> defaultValue = const []]) List<String>
Get a list env var (comma-separated).
has(String key) bool
Check if an env var is set.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
require(String key) String
Require an env var (throws if missing).
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](String key) String?
Get a string env var.

Static Properties

instance Env
final

Static Methods

setTestingValues(Map<String, String>? values) → void
Overrides environment values for tests. Pass null to reset.

Constants

isDev → const bool
Runtime mode.
isProd → const bool
isTest → const bool