Where To Start

Similar to most things in Flutter, we will have to import a package. The package is called geolocator. To add it to our project we have to open up the pubspec.yaml file and add the dependency like so:

The current version is 3.0.1

Pressing on the get packages prompt that shows up will make sure it is available to use within our project. Next, we import the package in our dart class:

Add this line to the top of your dart class file

To allow the application to know what permissions to ask for, we must modify the Info.plist file and the AndroidManifest.xml with the relevant permissions.

Info.plist