Config class

A global configuration manager that loads and provides access to environment variables.

It automatically loads values from a .env file if it exists and allows for runtime overrides.

Constructors

Config()
Internal constructor for Config.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

get(String key, [String? defaultValue]) → String?
Retrieves a configuration value by key.
getBool(String key, [bool defaultValue = false]) → bool
Retrieves a configuration value as a boolean.
getInt(String key, [int? defaultValue]) → int?
Retrieves a configuration value as an integer.
load() → void
Loads the .env file from the current working directory.
set(String key, dynamic value) → void
Sets a runtime override for a configuration key.