printLine function

String printLine(
  1. String line,
  2. int position,
  3. int maxNumLength,
  4. Settings settings,
)

Implementation

String printLine(
    String line, int position, int maxNumLength, Settings settings) {
  final n = position.toString();
  final formattedNum = n.padLeft(maxNumLength);
  final tabReplacement = repeatString(' ', settings.tabSize);
  return formattedNum + ' | ' + line.replaceAll('\t', tabReplacement);
}