I have been getting this error every time i use the PlacesAutoComplete widget. Search/request/response everything is working perfectly, no crashes or anything. But the logs show me this error on every search.
I added two packages for it: flutter_google_places and google_web_services.
And i dont use streams at all. So this is a really strange error for me.
I followed a couple of online guides for this, can anyone explain what am i doing wrong?
Also, i see that this is a pretty basic way to implement places autocomplete. I would love your suggestions on a better way to implement google places search.
Future<void> _searchWithPlacesAutoComplete() async {
Prediction _predictions = await PlacesAutocomplete.show(
context: context,
apiKey: GOOGLE_API_KEY,
onError: (response) => _showError(response),
mode: Mode.overlay,
language: "en",
components: [Component(Component.country, "uk")],
location: _currentLocation,
radius: 50,
);
if (_predictions != null) {
PlacesDetailsResponse detail =
await GoogleMapsPlaces(apiKey: GOOGLE_API_KEY)
.getDetailsByPlaceId(_predictions.placeId);
final lat = detail.result.geometry.location.lat;
final lng = detail.result.geometry.location.lng;
setState(() {
_markedPosition = new LatLng(lat, lng);
});
mapController.animateCamera(
CameraUpdate.newCameraPosition(
CameraPosition(
target: _markedPosition,
zoom: 16.0,
),
),
);
}
}
