toFormattedString method
String
toFormattedString({
- int nestingLevel = 0,
- String indent = '\t',
- bool encodeCharacterEntities = true,
- String? encodeCharacters,
- bool doubleQuotes = true,
override
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
@override
String toFormattedString({
int nestingLevel = 0,
String indent = '\t',
bool encodeCharacterEntities = true,
String? encodeCharacters,
bool doubleQuotes = true,
}) {
assert(nestingLevel >= 0);
var conditional = '<![ $condition ['.formatLine(nestingLevel, indent);
conditional += children.format(
nestingLevel: nestingLevel,
indent: indent,
encodeCharacterEntities: encodeCharacterEntities,
encodeCharacters: encodeCharacters,
doubleQuotes: doubleQuotes,
);
conditional += ']]>'.formatLine(nestingLevel, indent);
return conditional;
}