SourceSpanMixin class abstract
A mixin for easily implementing SourceSpan.
This implements the SourceSpan methods in terms of start, end, and text. This assumes that start and end have the same source URL, that start comes before end, and that text has a number of characters equal to the distance between start and end.
- Implemented types
- Implementers
- Available extensions
Constructors
Properties
- end → SourceLocation
-
The end location of this span, exclusive.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setteroverride
- length → int
-
The length of this span, in characters.
no setteroverride
- 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 setteroverride
- start → SourceLocation
-
The start location of this span.
no setterinherited
- text → String
-
The source text for this span.
no setterinherited
Methods
-
compareTo(
SourceSpan other) → int -
Compares two spans.
override
-
highlight(
{Object? color}) → String -
Prints the text associated with this span in a user-friendly way.
override
-
highlightMultiple(
String label, Map< SourceSpan, String> secondarySpans, {bool color = false, String? primaryColor, String? secondaryColor}) → String -
Available on SourceSpan, provided by the SourceSpanExtension extension
Like SourceSpan.highlight, but also highlightssecondarySpans
to provide the user with additional context. -
message(
String message, {Object? color}) → String -
Formats message in a human-friendly way associated with this span.
override
-
messageMultiple(
String message, String label, Map< SourceSpan, String> secondarySpans, {bool color = false, String? primaryColor, String? secondaryColor}) → String -
Available on SourceSpan, provided by the SourceSpanExtension extension
Like SourceSpan.message, but also highlightssecondarySpans
to provide the user with additional context. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
subspan(
int start, [int? end]) → SourceSpan -
Available on SourceSpan, provided by the SourceSpanExtension extension
Returns a span fromstart
code units (inclusive) toend
code units (exclusive) after the beginning of this span. -
toString(
) → String -
A string representation of this object.
override
-
union(
SourceSpan other) → SourceSpan -
Creates a new span that's the union of
this
andother
.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override