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

issues needs to fix #22

Open
Div-47 opened this issue Aug 15, 2022 · 8 comments
Open

issues needs to fix #22

Div-47 opened this issue Aug 15, 2022 · 8 comments
Assignees

Comments

@Div-47
Copy link

Div-47 commented Aug 15, 2022

if user selected any predictions then predictions should be empty and the text field also should be empty. and give some customisation in the text field , on changed in the autocomplete.

@hoc081098 hoc081098 self-assigned this Aug 15, 2022
@lepepper
Copy link

Issue- Flutter plugin : google_maps_webservice^0.0.20-nullsafety.5" "fields" Attribute gives error

I am using this
"google_maps_webservice^0.0.20-nullsafety.5" in flutter
&
flutter_google_places_hoc081098: ^1.0.1

Can some one please let me know, what I am doing wrong here

Signature:
Future getDetailsByPlaceId(
String placeId, {
String? sessionToken,
List fields = const [],
String? language,
String? region, }
)

Here is how iam using it

  PlacesDetailsResponse detail =
      await _places.getDetailsByPlaceId(
          p.placeId.toString(),
          fields: ['name'],		// Commenting g out this line, woruld make it work, bt i need this attribute/property to save cost
          language: 'fr',
          region:"fr",
      );

Issue:
fields: ['name'] => this "fields" attribute keeps failing,
I have seen so many tutorials , all are suggesting the same way,
but still it fails with the below message

E/flutter ( 9854): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: type 'Null' is not a subtype of type 'String' in type cast
E/flutter ( 9854): #0 _$PlaceDetailsFromJson (package:google_maps_webservice/src/places.g.dart:138:31)
E/flutter ( 9854): #1 new PlaceDetails.fromJson (package:google_maps_webservice/src/places.dart:710:7)
E/flutter ( 9854): #2 _$PlacesDetailsResponseFromJson (package:google_maps_webservice/src/places.g.dart:294:26)
E/flutter ( 9854): #3 new PlacesDetailsResponse.fromJson (package:google_maps_webservice/src/places.dart:838:7)
E/flutter ( 9854): #4 GoogleMapsPlaces._decodeDetailsResponse (package:google_maps_webservice/src/places.dart:528:29)
E/flutter ( 9854): #5 GoogleMapsPlaces.getDetailsByPlaceId (package:google_maps_webservice/src/places.dart:126:12)
E/flutter ( 9854):
E/flutter ( 9854): #6 _LocationPickerInitialState.goToPlace (package:myproj/screens/maps/initialOwnerLocationpicker.dart:149:11)
E/flutter ( 9854):

@hoc081098
Copy link
Owner

Issue- Flutter plugin : google_maps_webservice^0.0.20-nullsafety.5" "fields" Attribute gives error

I am using this
"google_maps_webservice^0.0.20-nullsafety.5" in flutter
&
flutter_google_places_hoc081098: ^1.0.1

Can some one please let me know, what I am doing wrong here

Signature:
Future getDetailsByPlaceId(
String placeId, {
String? sessionToken,
List fields = const [],
String? language,
String? region, }
)

Here is how iam using it

  PlacesDetailsResponse detail =
      await _places.getDetailsByPlaceId(
          p.placeId.toString(),
          fields: ['name'],		// Commenting g out this line, woruld make it work, bt i need this attribute/property to save cost
          language: 'fr',
          region:"fr",
      );

Issue:
fields: ['name'] => this "fields" attribute keeps failing,
I have seen so many tutorials , all are suggesting the same way,
but still it fails with the below message

E/flutter ( 9854): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: type 'Null' is not a subtype of type 'String' in type cast
E/flutter ( 9854): #0 _$PlaceDetailsFromJson (package:google_maps_webservice/src/places.g.dart:138:31)
E/flutter ( 9854): #1 new PlaceDetails.fromJson (package:google_maps_webservice/src/places.dart:710:7)
E/flutter ( 9854): #2 _$PlacesDetailsResponseFromJson (package:google_maps_webservice/src/places.g.dart:294:26)
E/flutter ( 9854): #3 new PlacesDetailsResponse.fromJson (package:google_maps_webservice/src/places.dart:838:7)
E/flutter ( 9854): #4 GoogleMapsPlaces._decodeDetailsResponse (package:google_maps_webservice/src/places.dart:528:29)
E/flutter ( 9854): #5 GoogleMapsPlaces.getDetailsByPlaceId (package:google_maps_webservice/src/places.dart:126:12)
E/flutter ( 9854):
E/flutter ( 9854): #6 _LocationPickerInitialState.goToPlace (package:myproj/screens/maps/initialOwnerLocationpicker.dart:149:11)
E/flutter ( 9854):

Thanks for report.

@lepepper
Copy link

lepepper commented Feb 1, 2023

Thanks for the response,
If there is a mistake on our side, and any remedial measures, please let me know.

@hoc081098
Copy link
Owner

@lepepper I will look at it tomorrow :))

@lepepper
Copy link

lepepper commented Feb 6, 2023

just a additional info , which might help

The Below code works and generates a proper url,
if the generated URL is opened in browser, the field attribute works

---Snip-----------
String detail =
_places.buildDetailsUrl(
placeId: p?.placeId.toString(),
//sessionToken: "sessionToken",
fields: ['name','formatted_address'],
region:"in",
language: 'en'
) ;

---Snip-----------

print (detail );

Also noticed one more minor anomaly in google_maps_webservice: ^0.0.20-nullsafety.5 package

google_maps_webservice
String buildDetailsUrl({
String? placeId,

@lepepper
Copy link

lepepper commented Feb 6, 2023

Also noticed one more minor anomaly in google_maps_webservice: ^0.0.20-nullsafety.5 package

String buildDetailsUrl({
String? placeId, --------------------->this is of type String?

Future getDetailsByPlaceId(
String placeId, { --------------------------------> --------------------->this is of type String

@lepepper
Copy link

lepepper commented Jul 7, 2023

Hi

can you please fix this issue

@lepepper
Copy link

lepepper commented Jul 7, 2023

@lepepper I will look at it tomorrow :))

Can you please fix the issue, or let is there something we are missing?
please update

will be happy to buy you coffee :-)

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

No branches or pull requests

3 participants