getDebugView method

String getDebugView()

Implementation

String getDebugView() {
  void recurseChildren(
    StringBuffer stringBuffer,
    Iterable<ConfigurationSection> children,
    String indent,
  ) {
    for (var child in children) {
      var valueAndProvider = _getValueAndProvider(this, child.path);

      if (valueAndProvider.item2 != null) {
        stringBuffer
          ..write(indent)
          ..write(child.key)
          ..write('=')
          ..write(valueAndProvider.item1)
          ..write(' (')
          ..write(valueAndProvider.item2)
          ..writeln(')');
      } else {
        stringBuffer
          ..write(indent)
          ..write(child.key)
          ..writeln(':');
      }

      recurseChildren(stringBuffer, child.getChildren(), '$indent  ');
    }
  }

  var builder = StringBuffer();
  recurseChildren(builder, getChildren(), '');

  return builder.toString();
}