calculateDistance static method

double calculateDistance(
  1. LatLng from,
  2. LatLng to
)

Calculate distance in meters between two coordinates

Implementation

static double calculateDistance(LatLng from, LatLng to) {
  return Geolocator.distanceBetween(
    from.latitude,
    from.longitude,
    to.latitude,
    to.longitude,
  );
}