Vector2 class
Vector2
A simple 2D vector class for representing points or directions in a 2D space.
Constructors
- Vector2.new(double x, double y)
-
const
- Vector2.fromOffset(Offset offset)
-
Create from Flutter's Offset
factory
Properties
Methods
-
add(
Vector2 other) → Vector2 -
copy(
) → Vector2 - Creates a new instance with the same values.
-
copyWith(
{double? x, double? y}) → Vector2 - Creates a new instance with optional updates.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toOffset(
) → Offset - Convert to Offset (optional but useful)
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator *(
double scalar) → Vector2 -
operator +(
Vector2 other) → Vector2 -
operator -(
Vector2 other) → Vector2 -
operator /(
double scalar) → Vector2 -
operator ==(
Object other) → bool -
The equality operator.
override