flutter-radar icon indicating copy to clipboard operation
flutter-radar copied to clipboard

Autocomplete null object reference error

Open jt274 opened this issue 1 year ago • 3 comments

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

jt274 avatar Jul 18 '24 04:07 jt274

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 avatar Jul 18 '24 16:07 KennyHuRadar

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.

KennyHuRadar avatar Jul 22 '24 19:07 KennyHuRadar

@KennyHuRadar Almost a year later and this issue still persists.

jt274 avatar Apr 07 '25 22:04 jt274