This is a public demo of the Baato App for Flutter. This app shows the way to integrate Baato map style in flutter using Mapbox.
This demo app requires a Baato account and a Baato access token. Obtain your access token on the Baato account page. Paste your access token in the line below in main.dart
file .
static const String BAATO_ACCESS_TOKEN = "your-baato-access-token";
If you encounter issue like Could not get unknown property 'android' for project ':mapbox_gl' of type org.gradle.api.Project.
or SDK Registry token is null. See README.md for more information.
you can solve the issue as mentioned here in the comment or follow the steps mentioned in the Android Configuration section below:
- Go to your Mapbox account dashboard and create an access token that has the
DOWNLOADS:READ
scope. PLEASE NOTE: This is not the same as your production Mapbox API token. Make sure to keep it private and do not insert it into strings.xml. - Set the System environment variable SDK_REGISTRY_TOKEN with the value of the private token taken from mapbox web page . Add for both System variables and User variable. Then restart the PC.
- Add the following code snippet into your module-level build.gradle where all the dependencies are defined. And build your app.
def token = System.getenv('SDK_REGISTRY_TOKEN')
if (token == null || token.empty) {
throw new Exception("SDK Registry token is null. See README.md for more information.")
}
- Voila! You are good to go.
-
Go to your Mapbox account dashboard and create an access token that has the
DOWNLOADS:READ
scope. PLEASE NOTE: This is not the same as your production Mapbox API token. Make sure to keep it private and do not insert it into any Info.plist file. Create a file named.netrc
in your home directory if it doesn’t already exist:touch .netrc open .netrc
machine api.mapbox.com login mapbox password PRIVATE_MAPBOX_API_TOKEN
where PRIVATE_MAPBOX_API_TOKEN is your Mapbox API token with the
DOWNLOADS:READ
scope. -
Set the System environment variable SDK_REGISTRY_TOKEN with the value of the private token taken from mapbox web page . If you are confused with setting environment variable in Mac, please follow the steps mentioned in the Setting env variables in Mac below. Then restart the PC.
-
Some iOS version also require location settings in default, for that goto your
Info.plist file
and setNSLocationWhenInUseUsageDescription
to:Shows your location on the map and helps improve OpenStreetMap.
-
To build on Android, add the following code snippet into your module-level build.gradle where all the dependencies are defined. And build your app.
def token = System.getenv('SDK_REGISTRY_TOKEN')
if (token == null || token.empty) {
throw new Exception("SDK Registry token is null. See README.md for more information.")
}
- Voila! You are good to go.
If you are getting issue with building in simulator, related to arm64 architecture, add the following lines into your ios>Podfile
installer code block:
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
- Open Terminal
- Run touch ~/.bash_profile; open ~/.bash_profile
- In TextEdit, add
export SDK_REGISTRY_TOKEN="sk.tygkisdsosiosisoispfsppsofisopisospisopsifsofsofspo"
. Please add the token you that you got from above steps. - Save the .bash_profile file and Quit (Command + Q) Text Edit.
- Run source ~/.bash_profile
For more info: https://hathaway.cc/2008/06/how-to-edit-your-path-environment-variables-on-mac/