Reader small image

You're reading from  Flutter Cookbook, Second Edition - Second Edition

Product typeBook
Published inMay 2023
Reading LevelIntermediate
PublisherPackt
ISBN-139781803245430
Edition2nd Edition
Languages
Tools
Right arrow
Author (1)
Simone Alessandria
Simone Alessandria
author image
Simone Alessandria

Simone Alessandria wrote his first program when he was 12. It was a text-based fantasy game for the Commodore 64. Now, he is a trainer (MCT), author, speaker, passionate software architect, and always a proud coder. He is the founder and owner of Softwarehouseit. His mission is to help developers achieve more through training and mentoring. He has authored several books on Flutter, including Flutter Projects, published by Packt, and web courses on Pluralsight and Udemy.
Read more about Simone Alessandria

Right arrow

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:

  1. 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.
  2. Import the http package to your pubspec.yaml.
  3. At the top of the main.dart file, add two new imports, one for http and another for...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Flutter Cookbook, Second Edition - Second Edition
Published in: May 2023Publisher: PacktISBN-13: 9781803245430

Author (1)

author image
Simone Alessandria

Simone Alessandria wrote his first program when he was 12. It was a text-based fantasy game for the Commodore 64. Now, he is a trainer (MCT), author, speaker, passionate software architect, and always a proud coder. He is the founder and owner of Softwarehouseit. His mission is to help developers achieve more through training and mentoring. He has authored several books on Flutter, including Flutter Projects, published by Packt, and web courses on Pluralsight and Udemy.
Read more about Simone Alessandria