Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

enter image description here

like image 335
sainu Avatar asked Apr 26 '26 01:04

sainu


2 Answers

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

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

like image 170
Hayi Nukman Avatar answered Apr 29 '26 22:04

Hayi Nukman


you can find another package for google place google_place

var googlePlace = GooglePlace("Your-Key");
var result = await googlePlace.autocomplete.get("1600 Amphitheatre");
like image 31
M.B Avatar answered Apr 29 '26 20:04

M.B



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!