Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Exception: Unhandled error type 'Null' is not a subtype of type 'String' calling getDetailsByPlaceId #103

Closed
dagix5 opened this issue Mar 31, 2021 · 5 comments · Fixed by #115

Comments

@dagix5
Copy link

dagix5 commented Mar 31, 2021

Calling getDetailsByPlaceId it throws this:
E/flutter ( 7283): #0 _$PlaceDetailsFromJson (package:google_maps_webservice/src/places.g.dart:136:37)
E/flutter ( 7283): #1 new PlaceDetails.fromJson (package:google_maps_webservice/src/places.dart:710:7)
E/flutter ( 7283): #2 _$PlacesDetailsResponseFromJson (package:google_maps_webservice/src/places.g.dart:294:26)
E/flutter ( 7283): #3 new PlacesDetailsResponse.fromJson (package:google_maps_webservice/src/places.dart:838:7)
E/flutter ( 7283): #4 GoogleMapsPlaces._decodeDetailsResponse (package:google_maps_webservice/src/places.dart:528:29)
E/flutter ( 7283): #5 GoogleMapsPlaces.getDetailsByPlaceId (package:google_maps_webservice/src/places.dart:126:12)

It seems that adr_address could be null.

version: 0.0.20-nullsafety.2

@lejard-h
Copy link
Owner

lejard-h commented Apr 3, 2021

I just published a new version.

Let me know if you have any other issue

@dagix5
Copy link
Author

dagix5 commented Apr 5, 2021

Hi, thanks for the new version but the same error occurs for utc_offset.
I edited places.dart manually in my project making nullable this field and it works for me.
I don't know if there are other similar problems.

@erf
Copy link
Contributor

erf commented Apr 6, 2021

I experienced the same now when calling GoogleMapsPlaces.searchByText. It fails in the following:


PlacesSearchResult _$PlacesSearchResultFromJson(Map<String, dynamic> json) {
  return PlacesSearchResult(
    id: json['id'] as String,

there is no id field in json.

I'm on version: ^0.0.20-nullsafety.3

@erf
Copy link
Contributor

erf commented Apr 6, 2021

Maybe PlacesSearchResult.id should be made optional..?

@mbilalakmal
Copy link
Contributor

Hi, thanks for the new version but the same error occurs for utc_offset.
I edited places.dart manually in my project making nullable this field and it works for me.
I don't know if there are other similar problems.

I can confirm that this is present in the latest null-safe version: 0.0.20-nullsafety.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants