Adding markers to a map
In this recipe, you will see how to make a query to the Google Maps Places service and add markers to the map in the app. Specifically, you will search for all restaurants near the user’s location within a radius of 1,000 meters.
By the end of this recipe, you will know how to query the huge Google Places archive and point to any place in your maps with a marker.
Getting ready
You should have completed two previous recipes from this chapter, Adding Google Maps to your app and Using location services, before following this one.
How to do it...
To add markers to the map in your project, perform the following steps:
- Navigate to the Google Maps API console and enable the Places API for your app. Make sure that your
Flutter Maps
project is selected, and then click the Enable button. - Import the
http
package to yourpubspec.yaml
. - At the top of the
main.dart
file, add two new imports, one forhttp
and another for...