getPropertyNames method
Returns the full list of property names known to this PropertySource.
Subclasses must implement this method to return all available keys.
Example:
final propertyNames = mySource.getPropertyNames();
print(propertyNames); // ['host', 'port', 'username']
This is used internally by containsProperty and other introspection features.
Implementation
@override
List<String> getPropertyNames() {
final namesList = ArrayList<List<String>>.withCapacity(_propertySources.length);
for (final propertySource in _propertySources) {
if (propertySource is! ListablePropertySource) {
throw IllegalStateException("Failed to enumerate property names due to non-enumerable property source: $propertySource");
}
List<String> names = propertySource.getPropertyNames();
namesList.add(names);
}
final allNames = HashSet<String>();
for (var names in namesList) {
allNames.addAll(names);
}
return allNames.toList();
}