Distance.withRadius constructor

Distance.withRadius(
  1. double radius, {
  2. bool roundResult = true,
  3. DistanceCalculator calculator = const Vincenty(),
})

Radius must be greater than 0.

Implementation

Distance.withRadius(final double radius,
    {final bool roundResult = true,
    final DistanceCalculator calculator = const Vincenty()})
    : _radius = radius,
      _roundResult = roundResult,
      _calculator = calculator {
  if (radius <= 0) {
    throw ArgumentError.value(
        radius, 'radius', 'Radius must be greater than 0');
  }
}