getChildKeys method

  1. @override
Iterable<String> getChildKeys(
  1. Iterable<String> earlierKeys,
  2. String? parentPath
)
override

Returns the immediate descendant configuration keys for a given parent path based on this ConfigurationProviders data and the set of keys returned by all the preceding ConfigurationProviders.

Implementation

@override
Iterable<String> getChildKeys(
  Iterable<String> earlierKeys,
  String? parentPath,
) {
  var section =
      parentPath == null ? _config : _config?.getSection(parentPath);

  var keys = <String>[];
  for (var child in section!.getChildren()) {
    keys.add(child.key!);
  }
  keys
    ..addAll(earlierKeys)
    ..sort(configurationKeyComparator);
  return keys;
}