title: How to create a simple google maps address search with autocomplete in flutter and get latitude and longitude?
body: <p>I'm new at Flutter and I'm trying to build a simple google maps app. I've already implemented google maps to the app and it is running perfect.</p>
  
  <p>But now I want to add google maps autocomplete and I can't find a simple tutorial or example that is focused on it.</p>
  
  <p>I have a TextField and I want to show places and addresses below it according to what the user types.</p>
  
  <p>After showing the results, I need to get its latitude and longitude to mark on the map. The code below represents my BottomSheet, that contains my TexField and need to implement some list below it after some written text.</p>
  
  <pre class="lang-java prettyprint-override"><code>void _settingModalBottomSheet(context) {
      double statusBarHeight = MediaQuery.of(context).padding.top;
  
      showModalBottomSheet(
        context: context,
        builder: (builder) {
          return Container(
            padding: EdgeInsets.only(top: statusBarHeight),
            color: Colors.transparent,
            child: Container(
              height: MediaQuery.of(context).size.height,
              decoration: BoxDecoration(
                color: Colors.blueAccent,
                borderRadius: BorderRadius.only(
                  topLeft: const Radius.circular(10.0), topRight: const Radius.circular(10.0))),
                child: Column(
                  children: &lt;Widget&gt;[
                    Padding(
                      padding: const EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0),
                      child: Container(
                        height: 50.0,
                        width: double.infinity,
                        decoration: BoxDecoration(
                          borderRadius: BorderRadius.circular(10.0),
                          color: Colors.white
                        ),
                        child: TextField(
                          textInputAction: TextInputAction.search,
                          decoration: InputDecoration(
                            hintText: "Para onde vamos?",
                            border: InputBorder.none,
                            contentPadding: EdgeInsets.only(left: 15.0, top: 15.0),
                            suffixIcon: IconButton(
                              icon: Icon(Icons.search),
                              onPressed: searchAndNavigate,
                              iconSize: 30.0,
                            )
                          ),
                          onChanged: (val) {
                            setState(() {
                              searchAddr = val;
                            }
                          );
                        },
                        onSubmitted: (term) {
                          searchAndNavigate();
                        },
                      ),
                    ),
                  ),
                ],
              )
            ),
          );
        }
      );
    }
  
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/PLdUn.png" rel="noreferrer"><img src="https://i.stack.imgur.com/PLdUn.png" alt="Current screen"></a></p>