distanceBetween method

Future<double> distanceBetween(
  1. double startLatitude,
  2. double startLongitude,
  3. double endLatitude,
  4. double endLongitude
)

Computes the approximate distance in meters between two locations.

See: https://developer.android.com/reference/android/location/Location#distanceBetween(double,%20double,%20double,%20double,%20float[])

Implementation

static Future<double> distanceBetween(double startLatitude,
    double startLongitude, double endLatitude, double endLongitude) async {
  assert(Platform.isAndroid);
  final request = <String, dynamic>{
    'startLatitude': startLatitude,
    'startLongitude': startLongitude,
    'endLatitude': endLatitude,
    'endLongitude': endLongitude,
  };
  return await _channel.invokeMethod('distanceBetween', request);
}