PrettyText class
A PrettyText is a PrettyNode has a text attribute.
- Inheritance
-
- Object
- PrettySourceSpan
- PrettyTextBase
- PrettyText
Constructors
- PrettyText({required String text, required SourceLocation start, required SourceLocation end, required SiblingPosition position})
Properties
- end → SourceLocation
-
The end location of this span, exclusive.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isFirstChild → bool
-
If this is the first child.
no setter
- isLastChild → bool
-
If this is the last child.
no setter
- length → int
-
The length of this span, in characters.
no setterinherited
- position → SiblingPosition
-
The position of this node in it's siblings.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sequence → int
-
finalinherited
- sourceUrl → Uri?
-
The URL of the source (typically a file) of this span.
no setterinherited
- start → SourceLocation
-
The start location of this span.
finalinherited
- text → String
-
The source text for this span.
finalinherited
- textContent → String
-
The composed string of text, leading spaces, trailing spaces and line
endings.
no setterinherited
Methods
-
accept(
PrettyNodeVisitor visitor) → void -
override
-
appendSpace(
) → void -
Adds a space to the end of this node.
inherited
-
appendSpaces(
int amount) → void -
Adds the given
amount
of spaces to the end of this node.inherited -
compareTo(
SourceSpan other) → int -
Compares two spans.
inherited
-
highlight(
{Object? color}) → String -
Prints the text associated with this span in a user-friendly way.
inherited
-
message(
String message, {Object? color}) → String -
Formats message in a human-friendly way associated with this span.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
prependSpace(
) → void -
Adds a space to the begining of this node.
inherited
-
prependSpaces(
int amount) → void -
Adds the given
amount
of spaces to the begining of this node.inherited -
toMap(
) → Map< String, dynamic> -
Outputs the attributes as a
Map
.override -
toString(
) → String -
A string representation of this object.
inherited
-
union(
SourceSpan other) → SourceSpan -
Creates a new span that's the union of
this
andother
.inherited -
updateText(
String text) → void -
Changes the text of this node with the given
text
.inherited -
writeln(
[bool append = true]) → void -
Adds a line ending to this node.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited