distance method

  1. @override
double distance(
  1. LatLng position,
  2. LatLng destination
)
override

Returns the distance between two geographical coordinates.

Implementation

@override
double distance(LatLng position, LatLng destination) {
  double dx = destination.lng - position.lng;
  double dy = destination.lat - position.lat;
  return math.sqrt(dx * dx + dy * dy);
}