matanshukry / flutter_google_places_sdk

Flutter plugin for google places native sdk
32 stars 68 forks source link

Accessing place photos (flutter web in chrome with flutter_google_places_sdk: ^0.3.0+1) #6

Closed log02 closed 2 years ago

log02 commented 2 years ago

It seems that the photo metadata are incomplete

var response = await this.googlePlace.fetchPlace(placeId, fields: [
        PlaceField.PhotoMetadatas,
]);
for (var photo in resonce.place!.photoMetadatas!) {
        print(photo);
}
// PhotoMetadata{attributions: <a href="https://maps.google.com/maps/contrib/104830505324877229444">Instinct Origine</a>, width: 2316, height: 2048}
// PhotoMetadata{attributions: <a href="https://maps.google.com/maps/contrib/104830505324877229444">Instinct Origine</a>, width: 4200, height: 3360}
// PhotoMetadata{attributions: <a href="https://maps.google.com/maps/contrib/104830505324877229444">Instinct Origine</a>, width: 2991, height: 3769}

The medata only contains the link to the contrib page. I was expecting the url to the images. I am missing something ?

Thank you for your lib

matanshukry commented 2 years ago

@log02 looks like the photo request is a different extra api request. Will make an api for it and implement in the next couple of days.

matanshukry commented 2 years ago

@log02 Uploaded new version with fetchPlacePhoto method: https://pub.dev/packages/flutter_google_places_sdk/versions/0.3.2