Offset class

A 2D offset in terminal character cells (integer-positioned).

Offsets can represent either a point relative to a separately-tracked origin (e.g. a child's position inside its parent) or a vector that can be added to other coordinates.

Annotations
  • @immutable

Constructors

Offset(int dx, int dy)
Stores an integer terminal-cell displacement of (dx, dy).
const

Properties

dx → int
The x component of the offset, in cells.
final
dy → int
The y component of the offset, in cells.
final
hashCode → int
The hash code for this object.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

operator &(Size other) → Rect
Combine this offset and a Size to form a Rect whose top-left corner is at this point and whose extent is the given size.
operator +(Offset other) → Offset
Returns the offset sum of this point and other.
operator -(Offset other) → Offset
Returns the offset difference between this point and other.
operator ==(Object other) → bool
The equality operator.
override

Constants

zero → const Offset
An offset with zero magnitude.