distance function Null safety

double distance(
  1. GpsPoint pointA,
  2. GpsPoint pointB,
  3. [DistanceCalcMode mode = DistanceCalcMode.auto]
)

Calculates the distance between pointA and pointB, optionally using a specific calculation mode to balance speed and accuracy.

Implementation

double distance(GpsPoint pointA, GpsPoint pointB,
    [DistanceCalcMode mode = DistanceCalcMode.auto]) {
  return distanceCoords(pointA.latitude, pointA.longitude, pointB.latitude,
      pointB.longitude, mode);
}