flutterlocation icon indicating copy to clipboard operation
flutterlocation copied to clipboard

Fix deprecation warnings

Open SamuelGadiel opened this issue 5 months ago • 1 comments

This PR resolves #1035

Migrated from deprecated LocationRequest to Priority Priority doesn't have a PRIORITY_NO_POWER property, according to its documentation we should use PRIORITY_PASSIVE

LocationRequest.PRIORITY_NO_POWER -> Priority.PRIORITY_PASSIVE


On SDK 31+ location.isFromMockProvider() is deprecated, but older versions of android still uses it, so we have to annotate the method with @SuppressWarnings("deprecation") If the project is running sdk 31+ we use location.isMock(), otherwise we fallback to location.isFromMockProvider()


For the LocationRequest.create() we have to use the new builder LocationRequest.Builder(). The parameters are passed to the builder, and not the mLocationRequest directly


The new Long() and new Float() were migrated to Number, and manipulated so we could have a proper Long and Float values

If I missed something, please point it out so I can fix it

SamuelGadiel avatar Aug 11 '25 19:08 SamuelGadiel

To view this pull requests documentation preview, visit the following URL:

docs.page/lyokone/flutterlocation~1036

Documentation is deployed and generated using docs.page.

docs-page[bot] avatar Aug 11 '25 19:08 docs-page[bot]