DartFormatter constructor

  1. {String lineEnding,
  2. int pageWidth,
  3. int indent,
  4. Iterable<StyleFix> fixes}

Creates a new formatter for Dart code.

If lineEnding is given, that will be used for any newlines in the output. Otherwise, the line separator will be inferred from the line endings in the source file.

If indent is given, that many levels of indentation will be prefixed before each resulting line in the output.

While formatting, also applies any of the given fixes.


    {this.lineEnding, int pageWidth, int indent, Iterable<StyleFix> fixes})
    : pageWidth = pageWidth ?? 80,
      indent = indent ?? 0 {
  if (fixes != null) this.fixes.addAll(fixes);