Reputation: 581
I'm trying to find a function that would allow me to get a Google Place only using a placeId (and the apiKey of course).
I found the function GeoDataClient.getPlaceById(placeId) but unfortunately this doesn't seem to be available on Flutter. I am currently using the flutter_google_places dart package but am open to using something different if necessary.
Upvotes: 2
Views: 1364
Reputation: 12681
I can't find one. It seems like something of a large gap in the ecosystem -- if you store a Google Place ID in your local database, you should be able to convert that into a place name and a location when you reload it.
The iOS equivalent of GeoDataClient
is the Places SDK for iOS: https://developers.google.com/places/ios-sdk/intro.
I may write a plugin for this and add it to pub.dev. Unless you've found a better solution since you posted this question, this seems like the best available approach at the moment.
With that said, however, connecting to the Google Places SDK requires a network connection, so if you want optimal performance, you should try to keep invocations of the SDK bridge to a bare minimum, and ideally keep place details in a local SQLite database. This way, users will only be invoking the SDK bridge after loading the app on a new device.
Upvotes: 0