radarlabs / flutter-radar

Flutter package for Radar, the leading geofencing and location tracking platform
https://radar.io
Apache License 2.0
22 stars 13 forks source link

Autocomplete null object reference error #56

Open jt274 opened 4 months ago

jt274 commented 4 months ago

For the Radar.autocomplete function, all parameters are listed as nullable. If the near parameter is not included, which according to the API reference docs is optional, the following error is returned by the SDK:

{error: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.util.HashMap.get(java.lang.Object)' on a null object reference}

This package often doesn't seem to follow the API references. For the autocomplete API, query is required, while near, layers, limit, country, mailable are optional. The flutter-radar package shows all parameters as nullable and returns the above error if near is null.

Source: https://radar.com/documentation/api#autocomplete

KennyHuRadar commented 4 months ago

Thank you for pointing out the issue. We are in the midst of consolidating our API interface on flutter. Do expect an update to our interface and our documentations soon.

KennyHuRadar commented 4 months ago

Hi @jt274 we just released a new version of flutter https://github.com/radarlabs/flutter-radar/releases/tag/3.10.0-beta.2 that tidies up our interface a little. It should address the issue you are facing. The documentations are not yet yet released as this update is still in beta, but feel free to ask questions you have about our interface here for the time being.