lejard-h / google_maps_webservice

BSD 3-Clause "New" or "Revised" License
168 stars 221 forks source link

fix nullable field 'name' in place details #116

Closed daveols closed 3 years ago

daveols commented 3 years ago

The PlaceDetails name field can sometimes be null. This PR fixes the following error when this occurs:

_CastError (type 'Null' is not a subtype of type 'String' in type cast)
daveols commented 3 years ago

I found that in my implementation using the type from this package, place_id was coming through as null as well which didn't make any sense for a place details request. I got things working again by simply adding name,place_id to the fields I was requesting from Google.

michaelgobbers commented 3 years ago

I think this PR was still valid to be honest and will contribute to the plugin. There are use case where you don't want the name. I one of my use cases I actually just request geometry field to be able to show it on google_maps.

Are you willing to reopen? If not I don't mind creating another PR for it.

daveols commented 3 years ago

@michaelgobbers fair enough!

I've reopened the PR here at #126