Iβm using flutter_google_places_hoc081098 (or the official Android Places SDK) to autocomplete addresses in my Flutter app. Despite explicitly setting country filters or lat/lng bias for the United States, I keep getting results for Canadian locations. Iβm physically located in the US (or so I believe), but the suggestions are still biased toward Canada What Iβve Tried Removing all code restrictions
Omitted components: [Component(Component.country, "us")], or set setCountries(listOf("US")) to see if that helps.
Same result: still seeing Canadian suggestions.
Forcing a US location + radius
Passed location: Location(lat: 40.7128, lng: -74.0060) (New York) and radius: 80000, plus strictbounds: true.
In theory, that should show addresses only around NYC.
Still mostly local Canadian results unless I type a very specific query like βNew York, NY, USA.β
Checking the deviceβs or emulatorβs location
Set the Android emulator location to Florida or NYC in Extended Controls β Location.
Verified the lat/lng is actually in the US.
No change in suggestions.
Confirming IP location
Visited iplocation.net to verify my IP geolocates in the US.
Still seeing Canadian addresses in the Places overlay.
Tried a VPN with a US endpoint; no consistent improvement.
Ensuring the old βPlaces APIβ is enabled
Billing is on, βPlaces API (New)β is enabled, also enabled the old βPlaces APIβ in Google Cloud.
Key restrictions are correct (app package name, SHA-1).
Key and billing are definitely working (no more REQUEST_DENIED unless I restrict the key incorrectly).
Typing a distinct US query
If I type βNew Yβ or βLos A,β I sometimes still get local βNew York Style Pizzaβ or βLos Amigosβ near me.
Must type βNew York, NY, USAβ fully to see the city.
This is better, but still not the auto-suggestions I want for US addresses by default.
this is my code to autocomplelocation: import 'package:flutter/material.dart'; import 'package:flutter_google_places_hoc081098/flutter_google_places_hoc081098.dart'; import 'package:google_maps_webservice/places.dart';
const kGoogleApiKey = "GOOGLE API KEY";
class LocationAutocompleteField extends StatelessWidget { final Function(String) onLocationSelected;
const LocationAutocompleteField({Key? key, required this.onLocationSelected}) : super(key: key);
@override Widget build(BuildContext context) { return TextFormField( readOnly: true, decoration: InputDecoration( hintText: "Enter your address", border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)), prefixIcon: Icon(Icons.location_on), ), onTap: () async { Prediction? prediction = await PlacesAutocomplete.show( context: context, apiKey: kGoogleApiKey, mode: Mode.overlay, language: "en", components: [Component(Component.country, "us")],
// Change "ca" to "us" for US places or remove this line to not restrict by country.
);
if (prediction != null && prediction.description != null) {
onLocationSelected(prediction.description!);
}
},
);
} }
flutter_google_places_hoc081098
orgoogle_maps_webservice
used in the sample code. With that, we suggest raising this issue in their respective repositories. You may use these links to report the issue: flutter_google_places_hoc081098 or google_maps_webservice This issue has been answered in the Google Public Issue Tracker, refer to this link.