[英]Flutter google_maps_places dont show places after search
I tried use google maps places to get lat/lng after searching to a places, with help the autoComplete function. 我尝试使用Google Maps地点搜索地点后,通过自动完成功能来获取经度/经度。
How can i solve this problem? 我怎么解决这个问题?
import 'package:flutter/material.dart';
import 'package:flutter_google_places/flutter_google_places.dart';
import 'package:google_maps_webservice/places.dart';
import 'package:geocoder/geocoder.dart';
// Google Api Key
const kGoogleApiKey = "....";
// to get places detail (lat/lng)
GoogleMapsPlaces _places = GoogleMapsPlaces(apiKey: kGoogleApiKey);
class PlaceSearchPage extends StatelessWidget {
final Color primaryColor, primaryColorAccent;
PlaceSearchPage({Key key, this.primaryColor, this.primaryColorAccent})
: super(key: key);
@override
Widget build(BuildContext context) => Scaffold(
backgroundColor: Colors.white,
body: Container(
child: Column(children: <Widget>[
TextField(
onSubmitted: (s) async {
Prediction p = await PlacesAutocomplete.show(
context: context,
apiKey: kGoogleApiKey,
mode: Mode.overlay, // Mode.fullscreen
language: "de",
components: [new Component(Component.country, "de"), new Component(Component.country, "en")]);
我发现了问题:`(错误日志=>“您已经超出了此API的每日请求配额。如果您没有设置自定义的每日请求配额,请确认您的项目具有有效的结算帐户: http:// g。 co / dev / maps-no-account “
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.