tomYamlEntry function

String tomYamlEntry(
  1. String key,
  2. Object? value,
  3. int indent,
  4. String nl,
)

The text of key: value, at column indent, ending in nl.

indent is the key's own column; a nested collection is indented two further, the shape the workspace's todo files already use.

Implementation

String tomYamlEntry(String key, Object? value, int indent, String nl) {
  final pad = ' ' * indent;
  final out = StringBuffer('$key:');
  _value(out, value, indent, nl);
  return '$pad$out';
}