odometer property

Future<double> get odometer

Retrieve the current distance-traveled ("odometer").

The plugin constantly tracks distance traveled, computing the distance between the current location and last and maintaining the sum. To fetch the current odometer reading:

Example

double odometer = await BackgroundGeolocation.getOdometer();

NOTE: Also see Config.desiredOdometerAccuracy to set control the accuracy of locations being used in odometer calculations.

WARNING: Odometer calculations are dependent upon the accuracy of received locations. If location accuracy is poor, this will necessarily introduce error into odometer calculations.

Implementation

static Future<double> get odometer async {
  return (await _methodChannel.invokeMethod<double>('getOdometer'))
      as FutureOr<double>;
}