Point2.from constructor

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

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

Implementation

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