Flutter google_maps_places dont show places after search

2,663

I found the problem :`( the error log => "You have exceeded your daily request quota for this API. If you did not set a custom daily request quota, verify your project has an active billing account: http://g.co/dev/maps-no-account"

Share:
2,663
Khalil Khalil
Author by

Khalil Khalil

Updated on December 13, 2022

Comments

  • Khalil Khalil
    Khalil Khalil over 1 year

    I tried use google maps places to get lat/lng after searching to a places, with help the autoComplete function.

    How can i solve this problem?

    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")]);
    
    
    • jdweng
      jdweng over 4 years
      The view is either behind the other views. Normally this happens when you add a control to the wrong control
    • Khalil Khalil
      Khalil Khalil over 4 years
      what do you main exactly? can you please add a axample for your resolve
    • Khalil Khalil
      Khalil Khalil over 4 years
      Is did works for one time then not more :(. a new Picture
    • jdweng
      jdweng over 4 years
      What did you change? Are you getting a valid response? Are you waiting to get the entire response before displaying?
  • jdweng
    jdweng over 4 years
    A view has layers. There is a Top View (what is visible) and a Back View (behind another View). So when you add a new item to a view it must be on Top to be seen.