FileSpan class Null safety
A SourceSpan within a SourceFile.
Unlike the base SourceSpan, FileSpan lazily computes its line and column values based on its offset and the contents of file. SourceSpan.message is also able to provide more context then SourceSpan.message, and SourceSpan.union will return a FileSpan if possible.
A FileSpan can be created using SourceFile.span.
- Implemented types
- Available Extensions
Constructors
- FileSpan()
Properties
- context → String
-
Text around the span, which includes the line containing this span.
read-onlyinherited
- end → FileLocation
-
The end location of this span, exclusive.
read-onlyoverride
- file → SourceFile
-
The file that
this
belongs to.read-only - hashCode → int
-
The hash code for this object.
read-onlyinherited
- length → int
-
The length of this span, in characters.
read-onlyinherited
- 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-onlyinherited
- start → FileLocation
-
The start location of this span.
read-onlyoverride
- text → String
-
The source text for this span.
finalinherited
Methods
-
compareTo(
SourceSpan other) → int -
Compares two spans.
inherited
-
expand(
FileSpan other) → FileSpan -
Returns a new span that covers both
this
andother
. -
highlight(
{dynamic color}) → String -
Prints the text associated with this span in a user-friendly way.
inherited
-
message(
String message, {dynamic color}) → String -
Formats message in a human-friendly way associated with this span.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited