distance static method

double distance(
  1. Offset point1,
  2. Offset point2
)

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);
}