Combain Slam SDK Flutter Plugin
This plugin is a wrapper for the Combain Slam SDK. It provides a simple way to integrate the SDK into your Flutter app.
Getting Started
Installation
To install the SDK you first need to edit your build.gradle for your android project. Open the build.gradle
located here:
.
├── README.md
├── ...
└── android/
├── build.gradle <-
├── app/
└── ...
Then add this code at the top:
allprojects {
repositories {
google()
mavenCentral()
maven {
url "https://gitlab.com/api/v4/projects/3194773/packages/maven"
}
}
}
Then you need to change the minSdk
version to 28 and the ext.kotlin_version
to 1.9.21
ext.kotlin_version = '1.9.21'
...
defaultConfig {
...
minSdk = 28
}
For a complete example see the example build.gradle
Then run:
flutter pub add flutter_slam_sdk
Android
For Android code minify and shrink needs to be disabled. To do this open your apps build.gradle
in your editor, located here: /android/app/build.gradle
Then add the following to your release and debug block:
android {
...
buildTypes {
release {
...
+ minifyEnabled false
+ shrinkResources false
...
}
debug{
+ minifyEnabled false
}
}
...
}
Using SDK
This is all the code needed to start receiving indoor location updates from the Combain Slam SDK.
FlutterSlamSDK slamSdk = FlutterSlamSDK(slamApiKey);
slamSdk.start();
slamSdk.addLocationUpdateListener(locationUpdateListener);
Demo
For a demo project see gitlab.combain.com/Hugo-Persson/flutter-slam-sdk-demo-app