-
-
Notifications
You must be signed in to change notification settings - Fork 695
Support to supply desired accuracy #25
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work :)
public void onListen(Object o, EventChannel.EventSink eventSink) { | ||
if (mStreamLocationService != null) { | ||
eventSink.error( | ||
"ALLREADY_LISTENING", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] Spelling error ALLREADY
-> ALREADY
.
"Access to location data denied. To allow access to location services enable them in the device settings.", | ||
null)); | ||
public void onCompletion(UUID taskID) { | ||
Iterator<Map.Entry<UUID, Result>> it = mResultHandles.entrySet().iterator(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mResultHandles.remove(taskID);
?
mEventSink.error("PERMISSION_DENIED", "Access to location data denied", null); | ||
mEventSink = null; | ||
} | ||
if (taskID == entry.getKey()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use .equals
instead. Otherwise you are comparing object references.
SignalResultHandles((result) -> result.error("ERROR", "Failed to get location.", null)); | ||
try { | ||
int index = (Integer) o; | ||
if(index > 0 && index < GeolocationAccuracy.values().length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should probably be if(index >= 0 && ...
✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)
Feature (resolves #1 )
Currently it is not possible to supply a desired accuracy, possible resulting in high battery use.
🆕 What is the new behavior (if this is a feature change)?
It is now possible to supply a desired accuracy when requesting the position.
💥 Does this PR introduce a breaking change?
Yes (see CHANGELOG.md)
🐛 Recommendations for testing
Run unit-tests:
flutter test
(or check results from Travis-CI)📝 Links to relevant issues/docs
Resolves #1
🤔 Checklist before submitting