indented static method

String indented(
  1. String content, {
  2. int indent = 1,
})

Implementation

static String indented(String content, {int indent = 1}) {
  var indentString = List.generate(indent, (index) => '  ').join('');

  content = content.replaceAll('\n', '\n$indentString');

  return '$indentString$content';
}