ConfigInterface class abstract interface

Defines the contract for a configuration management system.

This interface allows you to interact with application configuration settings, including retrieving, setting, checking existence, and managing entire configuration sections.

Ideal for use cases like loading .env, JSON, YAML, or any custom config sources.

Implementers

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

all() Map<String, dynamic>
Returns all loaded configuration values as a flat Map<String, dynamic>.
get<T>(String key, [T? defaultValue]) → T?
Retrieves the value associated with the given key.
getOrFail<T>(String key) → T
Returns the value of the key or throws an exception if not found.
has(String key) bool
Checks if a given key exists in the configuration.
loadFromRegistry(Map<String, Map<String, dynamic>> registry) → void
Loads configuration data from a registry map.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pop(String key) → void
Restores the previous value of a configuration key.
push(String key, dynamic value) → void
Temporarily overrides a configuration value. Useful for testing.
reload() → void
Reloads the configuration from its source.
section(String name) Map<String, dynamic>?
Retrieves an entire named configuration section as a nested map.
set(String key, dynamic value) → void
Sets a configuration value for the specified key.
toString() String
A string representation of this object.
inherited

Operators

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