distance static method
Calculates the distance between two points.
point1 is the first point.
point2 is the second point.
Implementation
static double distance(Offset point1, Offset point2) {
final dx = point2.dx - point1.dx;
final dy = point2.dy - point1.dy;
return math.sqrt(dx * dx + dy * dy);
}