Skip to content
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

[Bug]: Android backend needs to switch to the async API #195

Closed
3 of 4 tasks
lukehutch opened this issue Jan 30, 2024 · 1 comment
Closed
3 of 4 tasks

[Bug]: Android backend needs to switch to the async API #195

lukehutch opened this issue Jan 30, 2024 · 1 comment
Assignees

Comments

@lukehutch
Copy link

lukehutch commented Jan 30, 2024

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS

Steps to reproduce

The Android Geocoder docs say:

Warning: This API may hit the network, and may block for excessive amounts of time, up to 60 seconds or more. It's strongly encouraged to use the asynchronous version of this API. If that is not possible, this should be run on a background thread to avoid blocking other operations.

Expected results

Both the calls in the Android backend use the synchronous API, on the UI thread:

return geocoder.getFromLocationName(address, 5);
return geocoder.getFromLocation(latitude, longitude, 5);

Instead, these should be switched to the asynchronous API, which takes an additional callback parameter of type Geocoder.GeocodeListener.

Actual results

Currently the blocking API is used.

Code sample

N/A

Screenshots or video

N/A

Version

latest

Flutter Doctor output

N/A

@TimHoogstrate
Copy link
Contributor

Fixed by (#197)

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 a pull request may close this issue.

2 participants