triggerLocationTracker function

dynamic triggerLocationTracker(
  1. String methodChannel, {
  2. required dynamic startAfterTimestamp,
  3. required dynamic locationUpdateInterval,
  4. required dynamic stopAfterTimestamp,
})

Implementation

triggerLocationTracker(String methodChannel,
    {required var startAfterTimestamp,
    required var locationUpdateInterval,
    required var stopAfterTimestamp}) async {
  var platform = MethodChannel(methodChannel);
  try {
    await platform.invokeMethod('startLocationUpdates', {
      "startAfterTimestamp": startAfterTimestamp,
      "interval": locationUpdateInterval,
      "stopAfterTimestamp": stopAfterTimestamp,
    });
  } on PlatformException catch (e) {
    if (kDebugMode) {
      print("Error: $e");
    }
  }
}