Position class
Represents a line and character position, such as the position of the cursor.
Position objects are immutable. Use the {@link Position.withwith} or {@link Position.translatetranslate} methods to derive new positions from an existing position.
- Available extensions
- Annotations
-
- @JS()
- @staticInterop
Constructors
- Position.new(num line, num character)
-
factory
Properties
- character → num
-
Available on Position, provided by the Position$Typings extension
The zero-based character value.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- line → num
-
Available on Position, provided by the Position$Typings extension
The zero-based line value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- translate → ({Position Function(IInline0 change) $1, Position Function([num? lineDelta, num? characterDelta]) $2})
-
Available on Position, provided by the Position$Typings extension
Overload accessor: $1, $2no setter - with$ → ({Position Function(IInline1 change) $1, Position Function([num? line, num? character]) $2})
-
Available on Position, provided by the Position$Typings extension
Overload accessor: $1, $2no setter
Methods
-
compareTo(
Position other) → num -
Available on Position, provided by the Position$Typings extension
Compare this toother
. -
isAfter(
Position other) → bool -
Available on Position, provided by the Position$Typings extension
Check if this position is afterother
. -
isAfterOrEqual(
Position other) → bool -
Available on Position, provided by the Position$Typings extension
Check if this position is after or equal toother
. -
isBefore(
Position other) → bool -
Available on Position, provided by the Position$Typings extension
Check if this position is beforeother
. -
isBeforeOrEqual(
Position other) → bool -
Available on Position, provided by the Position$Typings extension
Check if this position is before or equal toother
. -
isEqual(
Position other) → bool -
Available on Position, provided by the Position$Typings extension
Check if this position is equal toother
. -
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