stopLocationDataFeed method

Future<bool> stopLocationDataFeed ()

Stops live location data feed from Platform

Implementation

Future<bool> stopLocationDataFeed() {
  var completer = Completer<bool>();
  try {
    _methodChannel.invokeMethod('stopLocationUpdate').then((result) {
      if (result == 1) {
        _eventChannel = null;
        _areWeGettingLocationUpdate = false;
        completer.complete(true);
      }
    });
  } on PlatformException {
    streamController.close();
    completer.complete(false);
  }
  return completer.future;
}