Vector2 constructor Null safety

Vector2(
  1. double x,
  2. double y
)

Construct a new vector with the specified values.

Implementation

factory Vector2(double x, double y) => Vector2.zero()..setValues(x, y);