You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering an issue with the GooglePlaceAutoCompleteTextField widget from the google_places_flutter package. Every time I type a location into the search bar and select a suggestion from the auto-suggested list, I receive an error in my console logs.
Error:
csharp
Copy code
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
#0 _GooglePlaceAutoCompleteTextFieldState.getPlaceDetailsFromPlaceId
google_places_flutter.dart:252
Steps to Reproduce:
1.Type a location into the GooglePlaceAutoCompleteTextField search bar.
2.Select any location from the suggested dropdown.
3.Observe the error in the console logs.
Additional Context:
The error seems to be related to the getPlaceDetailsFromPlaceId method, specifically when trying to access properties of the placeDetails object. I've ensured that the necessary API keys and configurations are correctly set up.
Thank you in advance.
Screenshots:
The text was updated successfully, but these errors were encountered:
I'm encountering an issue with the GooglePlaceAutoCompleteTextField widget from the google_places_flutter package. Every time I type a location into the search bar and select a suggestion from the auto-suggested list, I receive an error in my console logs.
Error:
csharp
Copy code
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
#0 _GooglePlaceAutoCompleteTextFieldState.getPlaceDetailsFromPlaceId
google_places_flutter.dart:252
Relevant Code:
dart
Copy code
Future<Response?> getPlaceDetailsFromPlaceId(Prediction prediction) async {
var url = "https://maps.googleapis.com/maps/api/place/details/json?placeid=${prediction.placeId}&key=${widget.googleAPIKey}";
Response response = await Dio().get(url);
PlaceDetails placeDetails = PlaceDetails.fromJson(response.data);
prediction.lat = placeDetails.result!.geometry!.location!.lat.toString();
prediction.lng = placeDetails.result!.geometry!.location!.lng.toString();
widget.getPlaceDetailWithLatLng!(prediction);
}
Steps to Reproduce:
1.Type a location into the GooglePlaceAutoCompleteTextField search bar.
2.Select any location from the suggested dropdown.
3.Observe the error in the console logs.
Additional Context:
The error seems to be related to the getPlaceDetailsFromPlaceId method, specifically when trying to access properties of the placeDetails object. I've ensured that the necessary API keys and configurations are correctly set up.
Thank you in advance.
Screenshots:
The text was updated successfully, but these errors were encountered: