Skip to content Skip to sidebar Skip to footer

_typeerror (type 'list' Is Not A Subtype Of Type 'placedetails')

Help me with this error: I am trying to get place value/name from displayPrediction() and show it in my textformfield Here is the call from TextFormField TextFormField( decoratio

Solution 1:

Just checkout your google places import dependency. It should be as follow

import'package:flutter_google_places/flutter_google_places.dart';

Also, checkout you have initialised the _places as

GoogleMapsPlaces_places= GoogleMapsPlaces(apiKey: "YOUR_API_KEY");

Solution 2:

The error is with p.description. I faced the same issue. Use it like this :

List address = [];
  address.add(p.description);

  print(address);

Post a Comment for "_typeerror (type 'list' Is Not A Subtype Of Type 'placedetails')"