Upgrading geolocator 0.0 to 1
Breaking0.0.2 → 1.7.0Breaking5Deprecated1New9Changed5Fixed13Other4
BreakingUpgrade verdict
5 breaking changes.
In plain terms
- The method for requesting the current location has a new name, so existing code must be updated.
- The two methods that convert between addresses and coordinates have clearer names, so existing code must be updated.
- On Android, permission requests can no longer overlap. Because of this, getting the location stream now returns a Future you must await.
- Code that requests a stream of location updates must now pass a LocationOptions object rather than a LocationAccuracy value.
Must act Top 4 of 6 that need code or config changes
Dart SDK requirement changed in 1.7.0: >=2.0.0-dev.28.0 <3.0.0 → >=2.0.0-dev.68.0 <3.0.0.
Adds permission_handler >=2.0.0 <3.0.0.
What you must change
Breaking5
Renames getPosition to getCurrentPosition.
getPositiongetCurrentPositionRenames toPlacemark and fromPlacemark to placemarkFromAddress and placemarkFromCoordinates.
toPlacemarkfromPlacemarkplacemarkFromAddressplacemarkFromCoordinatesFixes Android permissions being requested more than once simultaneously, changing getPositionStream to async.
getPositionStreamChanges getPositionStream to take LocationOptions instead of LocationAccuracy.
getPositionStreamLocationAccuracyLocationOptionsReplaces the getPosition and onPositionChanged properties with getPosition and getPositionStream methods that accept a desired accuracy.
getPositiononPositionChangedgetPositionStreamLocationAccuracyLocationAccuracy.BestDeprecations to plan for
Deprecated1
Deprecates the static checkGeolocationStatus method in favor of the instance method checkGeolocationPermissionStatus, with removal planned for version 2.0.
checkGeolocationStatuscheckGeolocationPermissionStatus