扑扑的google_maps_places搜索后不显示地点

时间:2019-08-11 03:10:44

标签: android google-maps flutter dart google-places-api

我尝试在自动完成功能的帮助下搜索位置后使用Google Maps位置获取经度/纬度。

我该如何解决这个问题?

Problem_picture


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")]);

1 个答案:

答案 0 :(得分:0)

我发现了问题:`(错误日志=>“您已经超出了此API的每日请求配额。如果您没有设置自定义的每日请求配额,请确认您的项目有一个有效的结算帐户:{{3 }}“