start method

Future<void> start()

Implementation

Future<void> start() async{
  bool enabled = await Geolocator.isLocationServiceEnabled();
  if(!enabled){
    throw  Exception('Location services are disabled');
  }
  LocationPermission p = await Geolocator.checkPermission();
  if(p == LocationPermission.denied){
    p = await Geolocator.requestPermission();
    if(p== LocationPermission.denied){
      throw Exception('Location permissions denied');
    }
  }
  if(p== LocationPermission.deniedForever){
    throw Exception('Location permisions are permanently denied');

  }
  await _uploader.start();
  const settings = LocationSettings(accuracy: LocationAccuracy.bestForNavigation,distanceFilter: 10);
  _subscription = Geolocator.getPositionStream(locationSettings: settings).listen(
      (pos) async{
        final  s = await _builder.fromPosition(pos);
        _uploader.enqueue(s);

  },
    onError: (e){},
    cancelOnError: false
  );
}