indented method

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

Implementation

String indented({int indent = 1}) {
  final indentString = List.generate(indent, (index) => '  ').join();
  final content = replaceAll('\n', '\n$indentString');

  return '$indentString$content';
}