Point2i.from constructor

Point2i.from(
  1. Iterable<num> coords, {
  2. int? offset,
})

A point from coords given in order: x, y.

Implementation

factory Point2i.from(Iterable<num> coords, {int? offset}) {
  final start = offset ?? 0;
  return Point2i.xy(
    coords.elementAt(start).round(),
    coords.elementAt(start + 1).round(),
  );
}