Flutter: Find places, get directions and work with Google Maps.

Address Search Field: 3.0.0

José Luna
2 min readNov 27, 2020

Everyone who has worked with flutter google maps have thought in work with addresses, find places using coordinates or street references and get directions to draw polylines in the map. Well, do it is easy peasy lemon squeezy now!

Lets see an example:

get directions from origin to destination with waypoints

The only requirement to use this plugin is a google key which can call to Google Places, Directions and Geocoding APIs.

A simple implementation to search an address could be the next:

this will show the plugin default widget to search addresses.

However, you can create your own address search widget using the builder:

this will show your own custom widget to search addresses.

And the most important..! to get directions you just need to use RouteSearchBox widget like in the next example:

the result of this code is the gif that you saw at top.

Don’t be afraid, it’s not a lot of code, just indentation :)

What WaypointsManager does? it’s an object which includes the list of address of the waypoints and a ValueNotifier to create an updateble widget that reacts when an address changes in the list.

I really don’t have more to say, i actually hope those examples help you to implement this plugin and give you a better and easier codding!

--

--