matanshukry / flutter_google_places_sdk

Flutter plugin for google places native sdk
36 stars 74 forks source link

Error while fetching Place (v0.3.5) #54

Closed aomicevic closed 1 year ago

aomicevic commented 1 year ago

Description: I'm encountering a type mismatch error when trying to parse the API response from the Google Places SDK using the FlutterGooglePlacesSdk package. The error message indicates that a type _Map<Object?, Object?> is not a subtype of Map<String, dynamic> in a type cast. This error occurs when i'm calling fetchPlace(placeId,fields: []) function.

Flutter Version: 3.10.2 FlutterGooglePlacesSdk Version: 0.3.5 Platform: iOS/Android/Web Error Message: _**flutter: FlutterGooglePlacesSdk::call error: type '_Map<Object?, Object?>' is not a subtype of type 'Map<String, dynamic>' in type cast [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: type '_Map<Object?, Object?>' is not a subtype of type 'Map<String, dynamic>' in type cast

0 _$$_PlaceFromJson (package:flutter_google_places_sdk_platform_interface/src/types/place.g.dart:21:44)

1 new _$_Place.fromJson (package:flutter_google_places_sdk_platform_interface/src/types/place.freezed.dart:391:7)

2 _$PlaceFromJson (package:flutter_google_places_sdk_platform_interface/src/types/place.freezed.dart:18:17)

3 new Place.fromJson (package:flutter_google_places_sdk_platform_interface/src/types/place.dart:45:7)

4 FlutterGooglePlacesSdkMethodChannel._responseFromPlaceDetails (package:flutter_google_places_sdk_platform_interface/method_channel_flutter_google_places_sdk.dart:106:38)

#5 FlutterGooglePlacesSdk._callMethod (package:flutter_google_places_sdk/flutter_google_places_sdk.dart:88:12) **_ I was using [0.3.2+9](https://pub.dev/packages/flutter_google_places_sdk/versions/0.3.2+9) version and everything was working fine few days ago.
PrzemyslawPluszowy commented 1 year ago

i have this error to , any solution, when i back to prev i have inuse compilation `: Error: Member not found: 'ALL'. flutter_google_places_sdk.dart:118 PlaceTypeFilter placeTypeFilter = PlaceTypeFilter.ALL, ^^^

: Error: No named parameter with the name 'placeTypeFilter'. flutter_google_places_sdk.dart:127 placeTypeFilter: placeTypeFilter, ^^^^^^^^^^^^^^^ : Error: The argument type 'List?' can't be assigned to the parameter type 'List' because 'List?' is nullable and 'List' isn't. flutter_google_places_sdk.dart:144

aomicevic commented 1 year ago

@PrzemyslawPluszowy I have the same issue when going back to the previous versions. Any solution?

PrzemyslawPluszowy commented 1 year ago

me to

elihaialgoaitech commented 1 year ago

Same here

PrzemyslawPluszowy commented 1 year ago

maybe someone found a solution?

matanshukry commented 1 year ago

I'm not sure why this started, but I added any_map to the configured de/serializers, and custom fromJson for case insensitive enums.

Also upgraded all versions and published, version 0.3.6.