newWith method

  1. @override
Point2i newWith({
  1. num x = 0.0,
  2. num y = 0.0,
  3. num? z,
  4. num? m,
})
override

Creates a new point instance of a type compatible with this object.

Values for a new point are given by required x and y values, and optional z and z values as applicable or an implementing class.

When newWith is implemented by the Point class itself or it's descentants then a returned instance must be of the type with same coordinate value members as this object has.

Implementation

@override
Point2i newWith({num x = 0.0, num y = 0.0, num? z, num? m}) =>
    Point2i(x: x.round(), y: y.round());