IntOffset class

A 2D offset with integer coordinates.

This class represents a point in a 2D coordinate system using integer values. It can be used to represent positions, translations, or any other 2D vector with discrete coordinates.

Constructors

IntOffset([int x = 0, int y = 0])
Creates an IntOffset with the given x and y coordinates.
const

Properties

hashCode int
Generates a hash code for this offset.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
x int
The x-coordinate of the offset.
final
y int
The y-coordinate of the offset.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Returns a string representation of the offset.
override
translate(int dx, int dy) IntOffset
Creates a new IntOffset translated by the given amounts.

Operators

operator *(int scalar) IntOffset
Multiplies the offset by a scalar value.
operator +(IntOffset other) IntOffset
Adds two IntOffsets and returns their sum as a new IntOffset.
operator -(IntOffset other) IntOffset
Subtracts one IntOffset from another and returns their difference.
operator ==(Object other) bool
Checks if this offset is equal to another object.
override
operator ~/(int scalar) IntOffset
Divides the offset by a scalar value using integer division.