distanceBetween static method

double distanceBetween(
  1. double startLatitude,
  2. double startLongitude,
  3. double endLatitude,
  4. double endLongitude,
)

Calculates the distance between the supplied coordinates in meters.

The distance between the coordinates is calculated using the Haversine formula (see https://en.wikipedia.org/wiki/Haversine_formula). The supplied coordinates startLatitude, startLongitude, endLatitude and endLongitude should be supplied in degrees.

Implementation

static double distanceBetween(
  double startLatitude,
  double startLongitude,
  double endLatitude,
  double endLongitude,
) =>
    GeolocatorPlatform.instance.distanceBetween(
      startLatitude,
      startLongitude,
      endLatitude,
      endLongitude,
    );