Text class
A plain text element.
- Implemented types
- Implementers
Constructors
- Text(String text, {required SourceLocation start, required SourceLocation end, int? tabRemaining, bool lineEndingToWhitespace = false})
- Text.fromSpan(SourceSpan span, {int? tabRemaining, bool lineEndingToWhitespace = false})
-
Instantiates a Text from
span
. - Text.fromString(String text, {SourceLocation? start, SourceLocation? end})
-
Instantiates a Text from
String
text
.
Properties
- end → SourceLocation
-
The end location of this span, exclusive.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- length → int
-
The length of this span, in characters.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- 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
-
no setteroverride
Methods
-
accept(
NodeVisitor visitor) → void -
override
-
compareTo(
SourceSpan other) → int -
Compares two spans.
inherited
-
concat(
SourceSpan other) → Text -
Combines
this
and the adjacentother
. -
highlight(
{Object? color}) → String -
Prints the text associated with this span in a user-friendly way.
inherited
-
htmlText(
{bool escapesDoubleQuotes = true, bool decodeHtmlCharacter = true}) → String - Converts text to the result which meets the CommonMark specification, includinug:
-
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
-
subText(
int start, [int? end]) → Text -
toMap(
) → Map< String, dynamic> -
Outputs the attributes as a
Map
.override -
toString(
) → String - A string representation of this object.
-
union(
SourceSpan other) → SourceSpan -
Creates a new span that's the union of
this
andother
.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited