matanshukry / flutter_google_places_sdk

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

Searching for CITIES and ADDRESS in the same placeTypeFilter array returns no results. #69

Closed andersonmendesdev closed 5 months ago

andersonmendesdev commented 5 months ago

When searching for FindAutocompletePredictionsResponse with CITIES and ADDRESS at the same time, I don't get any results on iOS, but if I pass them individually, everything works. If I pass an empty array then I receive all the results. Any suggestion?

Not working

final result = await _placeSDK.findAutocompletePredictions(query,
    countries: ['BR'],
    placeTypesFilter:  [PlaceTypeFilter.CITIES, PlaceTypeFilter.ADDRESS],
    newSessionToken: false,
    origin: origin
);

Working

final result = await _placeSDK.findAutocompletePredictions(query,
    countries: ['BR'],
    placeTypesFilter:  [],
    newSessionToken: false,
    origin: origin
);

Lib flutter_google_places_sdk: ^0.3.7

Flutter doctor

[✓] Flutter (Channel stable, 3.16.5, on macOS 13.6.1 22G313 darwin-x64, locale en-BR)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] VS Code (version 1.85.1)
[✓] Connected device (3 available)            
[✓] Network resources
andersonmendesdev commented 5 months ago

The place documentation says that table 3 can only have one entry at a time.

_This API can take an array of up to 5 entries from table_1 or table_2, but only a single entry in table_3. Default value is null, which means no filters specified. Overrides the deprecated "type" property if this is set._

table_3 geocode, address, establishment, (regions), (cities)