containsProperty method

  1. @override
bool containsProperty(
  1. String name
)
override

Returns true if this property source contains a value for the given property name.

This method delegates to getProperty, interpreting any non-null value as presence of the property. Concrete subclasses may override this for more efficient lookups (e.g., direct Map.containsKey checks), but the default implementation provides a safe, consistent fallback.

This method does not distinguish between:

  • missing properties, and
  • properties explicitly set to null

because property sources commonly treat null as “not defined.”

Implementation

@override
bool containsProperty(String name) {
  for (final propertySource in _propertySources) {
    if (propertySource.containsProperty(name)) {
      return true;
    }
  }

  return false;
}