Adding Google Maps to your app
Most packages and plugins don’t require any configuration other than typing flutter pub add
in a Terminal window. But a few plugins require additional steps, like getting API keys or adding platform-specific configurations. One of these plugins is also one of the most useful: the Google Maps plugin. This recipe shows you how to add it to a Flutter app.
Specifically, you will see how to get a Google Maps API key, how to add Google Maps to your Android and iOS project, and how to show a map on the screen.
By the end of this recipe, you’ll know how to integrate Google Maps into your projects.
Getting ready
In this recipe, you will create a new project.
How to do it...
In this recipe, you will add Google Maps to your app. Follow the instructions below:
- Create a new Flutter app, and call it
map_recipe
. - Add the Google Maps package dependency to the project’s
pubspec.yaml
file. The name of the package...