TextLine class

Represents a line of text, such as a line of source code.

TextLine objects are immutable. When a {@link TextDocumentdocument} changes, previously retrieved lines will not represent the latest state.

Available extensions
Annotations
  • @JS()
  • @staticInterop
  • @anonymous

Constructors

TextLine.new({num? lineNumber, String? text, Range? range, Range? rangeIncludingLineBreak, num? firstNonWhitespaceCharacterIndex, bool? isEmptyOrWhitespace})
factory

Properties

firstNonWhitespaceCharacterIndex num

Available on TextLine, provided by the TextLine$Typings extension

The offset of the first character which is not a whitespace character as defined by /\s/. Note that if a line is all whitespace the length of the line is returned.
no setter
hashCode int
The hash code for this object.
no setterinherited
isEmptyOrWhitespace bool

Available on TextLine, provided by the TextLine$Typings extension

Whether this line is whitespace only, shorthand for {@link TextLine.firstNonWhitespaceCharacterIndex} === {@link TextLine.textTextLine.text.length}.
no setter
lineNumber num

Available on TextLine, provided by the TextLine$Typings extension

The zero-based line number.
no setter
range Range

Available on TextLine, provided by the TextLine$Typings extension

The range this line covers without the line separator characters.
no setter
rangeIncludingLineBreak Range

Available on TextLine, provided by the TextLine$Typings extension

The range this line covers with the line separator characters.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text String

Available on TextLine, provided by the TextLine$Typings extension

The text of this line without the line separator characters.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited