PropertiesPropertySource class

A specialized MapPropertySource that represents traditional Java-style .properties-like configuration, Dart-style .dart-like configuration, Environment .env-like configuration, and YAML-style .yaml-like configuration as a Dart Map.

It provides semantic clarity when you're loading configurations from a .properties file or equivalent structured source, and is typically used in environments where key-value pairs are treated as flat string mappings.

This class does not add new behavior to MapPropertySource, but helps clearly differentiate the source of configuration in a MutablePropertySources stack.

Example usage:

final props = {
  'server.port': '8080',
  'logging.level': 'INFO',
};

final propertySource = PropertiesPropertySource('application.properties', props);

print(propertySource.getProperty('server.port')); // 8080

This can be combined with other sources for layered configuration.

Inheritance

Constructors

PropertiesPropertySource(String name, Map<String, Object> properties)
A specialized MapPropertySource that represents traditional Java-style .properties-like configuration, Dart-style .dart-like configuration, Environment .env-like configuration, and YAML-style .yaml-like configuration as a Dart Map.

Properties

hashCode int
The hash code for this object.
no setterinherited
name String
The unique name that identifies this property source. Typically used for logging, debugging, and source resolution order.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source Map<String, Object>
The underlying object that holds the raw property data.
finalinherited

Methods

containsProperty(String name) bool
Returns true if this property source contains the given name.
inherited
equalizedProperties() List<Object?>
Mixin-style contract for value-based equality, hashCode, and toString.
inherited
getName() String
Returns the name of this property source.
inherited
getProperty(String name) Object?
Retrieves the value associated with the given name, or null if not present.
inherited
getSource() Map<String, Object>
Returns the underlying source object.
inherited
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