Skip to content

Fix deprecation warnings #1036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SamuelGadiel
Copy link

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

Copy link

docs-page bot commented Aug 11, 2025

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

docs.page/lyokone/flutterlocation~1036

Documentation is deployed and generated using docs.page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix deprecation messages when building the app
1 participant