distanceBetween method

  1. @override
double distanceBetween({
  1. required double startLatitude,
  2. required double startLongitude,
  3. required double endLatitude,
  4. required double endLongitude,
})
override

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

@override
double distanceBetween({
  required double startLatitude,
  required double startLongitude,
  required double endLatitude,
  required double endLongitude,
}) {
  return Geolocator.distanceBetween(startLatitude, startLongitude, endLatitude, endLongitude);
}