Situm Wayfinding for Flutter. Integrate plug&play navigation experience with floor plans, POIs, routes and turn-by-turn directions in no time. With the power of Situm.
There is a comprehensive tutorial on how to set-up a new application using this plugin on the Situm documentation page.
Below you will find the basic steps to install and configure the plugin on your Flutter project. These steps have already been done for you in the example application of this repository, but they are required for other projects.
Starting with version 4.0.0, this plugin requires:
- Flutter 3.44.0 or later
- Dart 3.12.0 or later
- iOS 16.0 or later
Check the example/README file of this repository to create your first Flutter application using Situm Flutter.
To add the Situm dependency to your Flutter project, you can use the flutter pub add command. To add this dependency to your project, you can use the following command in your terminal:
flutter pub add situm_flutter
Create a new config.dart file with your Situm credentials. You can use the contents of example/config.dart.example as example.
Follow the Wayfinding guide if you haven't set up a Situm account.
- Add the
ACCESS_FINE_LOCATIONpermission to yourAndroidManifest.xmlfile if you have configured Situm SDK to use GPS:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />- Set the
minSdkVersionto 21 or later on your app'sbuild.gradlefile.
On iOS, the plugin supports both CocoaPods and Swift Package Manager for native dependencies. Flutter 4.0.0 and later enables Swift Package Manager by default.
Note
For local development with the example app and Swift Package Manager, clone or
place this repository in a folder named situm_flutter. Some Flutter versions
generate local Swift package overrides using the plugin directory name, and a
different checkout folder name can cause Swift package resolution failures.
The repository folder name requirement only affects local development of this
repository and the bundled example app when using Swift Package Manager. Apps
that consume situm_flutter from pub.dev are not affected.
If your project uses CocoaPods:
-
Remove the "use_frameworks!" directive in the
Podfileof your iOS project. -
Run
pod installorpod updateto bring the dependencies to your project.
For both CocoaPods and Swift Package Manager:
- Declare the following permissions in your app's
Info.plistfile to successfully start positioning:
<key>NSLocationWhenInUseUsageDescription</key>
<string>Location is required to find out where you are</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Location is required to find out where you are</string>
<key>NSMotionUsageDescription</key>
<string>We use your phone sensors (giroscope, accelerometer and altimeter) to improve location quality</string>
- For offline support you will have to add the underlying web application's domain inside the entry
WKAppBoundDomainsonInfo.plistas follows:
<key>WKAppBoundDomains</key>
<array>
<string>map-viewer.situm.com</string>
</array>
Migrate from the old Situm Flutter Wayfinding plugin
The new Situm Flutter package breaks compatibility with the previous Situm Flutter Wayfinding plugin. Integrating the new version is simpler and more straightforward. If you want to migrate your application, follow the steps described in the Situm documentation.
Please refer to CHANGELOG.md for a list of notable changes for each version of the plugin.
You can also see the tags on this repository.
You will need to sign a Contributor License Agreement (CLA) before making a submission. Learn more here.
This project is licensed under the MIT - see the LICENSE file for further details.
More info is available at our Developers Page.
For any question or bug report, please send an email to support@situm.com