SourceSpanMixin class Null safety
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.
read-onlyinherited
- hashCode → int
-
The hash code for this object.
read-onlyoverride
- length → int
-
The length of this span, in characters.
read-onlyoverride
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- sourceUrl → Uri?
-
The URL of the source (typically a file) of this span.
read-onlyoverride
- start → SourceLocation
-
The start location of this span.
read-onlyinherited
- text → String
-
The source text for this span.
read-onlyinherited
Methods
-
compareTo(
SourceSpan other) → int -
Compares two spans.
override
-
highlight(
{dynamic color}) → String -
Prints the text associated with this span in a user-friendly way.
override
-
message(
String message, {dynamic color}) → String -
Formats message in a human-friendly way associated with this span.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
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