Learn how to get the current location and integrate map to our flutter application.
Used packages:
-
json_serializable For json deserialization
-
geolocator To get current user location
-
google_maps_flutter To Display map
-
http to send network request nearby data
- Set minSdk
android {
defaultConfig {
minSdkVersion 20
}
}
- First create api key from google cloud console for map then replace in the AndroidManifest
<application ...
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="YOUR KEY HERE"/>
- Create api key from https://www.geoapify.com/ and replace in api_keys.dart file
factory ApiKeys.sandBox() {
return ApiKeys(key: 'replace-your-keys-from-https://www.geoapify.com/');
}