Indent class

A helper class for managing indentation, wrapping a StringSink.

Constructors

Indent(StringSink _sink)
Constructor which takes a StringSink Ident will wrap.

Properties

hashCode int
The hash code for this object.
no setterinherited
newline String
String used for newlines (ex "\n").
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tab String
String used to represent a tab.
final

Methods

add(String text) → void
Just adds text.
addln(String text) → void
Add text with a newline.
addScoped(String? begin, String? end, Function func, {bool addTrailingNewline = true, int nestCount = 1}) → void
Scoped increase of the indent level.
dec([int level = 1]) → void
Decrement the indentation level.
format(String input, {bool leadingSpace = true, bool trailingNewline = true}) → void
Replaces the newlines and tabs of input and adds it to the stream.
inc([int level = 1]) → void
Increase the indentation level.
nest(int count, Function func) → void
Scoped increase of the indent level.
newln([int lines = 1]) → void
Adds lines number of newlines.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
str() String
Returns the String representing the current indentation.
toString() String
A string representation of this object.
inherited
write(String text) → void
Add text with indentation.
writeln(String text) → void
Add text with indentation and a newline.
writeScoped(String? begin, String end, Function func, {bool addTrailingNewline = true}) → void
Like addScoped but writes the current indentation level.

Operators

operator ==(Object other) bool
The equality operator.
inherited