toFormattedString method

String toFormattedString(
  1. {int nestingLevel = 0,
  2. String indent = '\t'}
)

Returns this node as a formatted string.

Each child is returned further indented by indent with each nestingLevel.

If lineLength isn't null, lines will be broken when they reach lineLength in length. Some lines may not be broken by lineLength if a clean way to break them can't be detected.

nestingLevel must not be null and must be >= 0.

indent defaults to \t (tab) and must not be null.

lineLength must not be null and must be > 0.

Implementation

String toFormattedString({
  int nestingLevel = 0,
  String indent = '\t',
}) {
  assert(nestingLevel >= 0);
  return toString().formatLine(nestingLevel, indent);
}