copyWith method

Vector2 copyWith({
  1. double? x,
  2. double? y,
})

Creates a new instance with optional updates.

Implementation

Vector2 copyWith({double? x, double? y}) => Vector2(x ?? this.x, y ?? this.y);