简体   繁体   中英

Google Places API in Flutter

I am working on google places API with Flutter. I am working by referring the example . But I got errors for google places API classes as

Eg:

Undefined class 'GoogleMapsPlaces'. Try changing the name to the name of an existing class, or creating a class with the name

I imported the flutter_google_places in my dart file as:

import 'package:flutter_google_places/flutter_google_places.dart'; But still I got the error for all classes.

Using flutter_google_places version 0.2.3 .

在此处输入图片说明

GoogleMapPlaces is available on different library, not in flutter_google_places...

it's available on https://pub.dev/packages/google_maps_webservice

you can find another package for google place google_place

var googlePlace = GooglePlace("Your-Key");
var result = await googlePlace.autocomplete.get("1600 Amphitheatre");

You need to import import 'package:google_maps_webservice/places.dart'; in your main.dart.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM