isInsideRadius static method

bool isInsideRadius(
  1. LatLng location,
  2. LatLng fromCenter,
  3. double radius, {
  4. DistanceAlgorithmType algorithm = DistanceAlgorithmType.Haversine,
  5. LengthUnit unit = LengthUnit.M,
})

Implementation

static bool isInsideRadius(
  LatLng location,
  LatLng fromCenter,
  double radius, {
  DistanceAlgorithmType algorithm = DistanceAlgorithmType.Haversine,
  LengthUnit unit = LengthUnit.M,
}) {
  double distance = distanceBetween(
    fromCenter,
    location,
    algorithm: algorithm,
    unit: unit,
  );
  return distance <= radius;
}