processLocation method
Feed an externally sourced GPS fix into the tracking pipeline.
Use this when receiving location data from an external hardware GPS receiver (Bluetooth OBD, serial GPS, etc.).
Implementation
Future<bool> processLocation({
required double lat,
required double lng,
required double speed,
required double heading,
double accuracy = 0.0,
double altitude = 0.0,
int? timestamp,
}) async {
try {
final result = await _method.invokeMethod<bool>(
'processExternalLocation',
{
'lat': lat,
'lng': lng,
'speed': speed,
'heading': heading,
'accuracy': accuracy,
'altitude': altitude,
'timestamp': timestamp ?? DateTime.now().millisecondsSinceEpoch,
},
);
return result ?? false;
} on PlatformException {
rethrow;
}
}