Flutter Google Maps: search, find and work with Addresses

José Luna
2 min readMay 16, 2020

See the new version with better features:

When we use google_maps_flutter plugin, we usually have to work with LatLng objects to send and get latitudes and longitudes of places that we want to show or places where we want to move or they help us to draw polylines on our map. But, what about if we want to do this process or more only using addresses?

To do this, we have address_search_field plugin. It’s a text field that displays an address search box to find a location by typing a reference and gets nearby addresses. Selecting the desired address returns an object with the latitude, longitude, and full address of the place. It helps to continue working with LatLng objects and give you the way to make your users use the map just typing an address.

Here we have an example using google maps and address search field, you just need to use the GoogleMapController to move the camera around the map using the AddressPoint which contains data about the place that you select in the AddressSearchBox widget using its onDone function.

https://gist.github.com/JosLuna98/c8052d464a5c1b2ca322b89c3c35bee2

So, as we saw, we only need two things to make all this possible:

  • Verify that _googleMapController is set.
  • Check if the point.found is true.

It’s done!! that’s a simple example that shows you how to implement address_search_field with google_maps_flutter to work with addresses to move around the map in our Flutter App.

--

--