flutter-geolocator icon indicating copy to clipboard operation
flutter-geolocator copied to clipboard

getPositionStream(locationOptions).listen(...

Open mpoirier101 opened this issue 6 years ago • 1 comments

🔙 Regression

Flutter 1.22.0 • channel stable • https://github.com/flutter/flutter.git Framework • revision d408d302e2 (5 days ago) • 2020-09-29 11:49:17 -0700 Engine • revision 5babba6c4d Tools • Dart 2.10.0 geolocator 6.0.0+4

getPositionStream does not recognize "LocationOptions" object as parameter.

Current behavior

final LocationOptions _locationOptions = LocationOptions(accuracy: LocationAccuracy.best, distanceFilter: 50, forceAndroidLocationManager: false, timeInterval: 0); error message: Too many positional arguments: 0 expected, but 1 found. Try removing the extra positional arguments, or specifying the name for named arguments.

Reproduction steps

Configuration

Version: 1.x

Platform:

  • [ ] :iphone: iOS
  • [ ] :robot: Android

mpoirier101 avatar Oct 04 '20 12:10 mpoirier101

Hi @mpoirier101,

This is correct, in version 6.0.0 we introduced a breaking change to simplify the API. Before you had to supply a permission level (related to permission management) and location options (related to location management) to the getPositionStream method. Since version 6.0.0 you no longer need to supply the permission level since the geolocator is now able to figure this out by itself (scanning the permissions listed in either the AndroidManifest.xml file on Android or the Info.plist file on iOS). This means the API now only has to worry about parameters related to location management and we decided there is no need anymore to group them into a separate class.

Hope this answers your question. Please refer to the API reference for the complete overview of the new method signatures.

mvanbeusekom avatar Oct 05 '20 09:10 mvanbeusekom