mapsted_flutter 0.0.3
mapsted_flutter: ^0.0.3 copied to clipboard
A Flutter plugin for integrating Mapsted's advanced location and mapping technology, offering easy access to precise indoor and outdoor navigation features.
Usage #
First, add mapsted_flutter as a dependency in your pubspec.yaml file.
dependencies:
mapsted_flutter: ^0.0.3
Don't forget to flutter pub get.
Setting the mapsted plugin config #
Run below command in your project directory in terminal
dart run mapsted_flutter:create
Platform Specific Configurations #
iOS #
- Project/ios/Podfile Add source file on top.
source 'https://cdn.cocoapods.org/'
# To run in simulator add below source target
source 'https://github.com/Mapsted/podspec-simulator.git'
# To run in device add below source target
source 'https://github.com/Mapsted/podspec.git'
- Project/ios/Podfile set use frameworks in your app target
use_frameworks!
IMPORTANT
- Add license file in Resources folder
your_ios_license.key
Android #
- Set the
minSdkVersioninandroid/app/build.gradle:
android {
defaultConfig {
minSdkVersion 24
}
}
- Add packaging options and enable data binding : Locate the android block in your app/build.gradle file and update it to include both packagingOptions and dataBinding settings:
packagingOptions {
exclude 'META-INF/LICENSE.md'
exclude 'META-INF/NOTICE.md'
exclude 'META-INF/gradle/incremental.annotation.processors'
}
dataBinding {
enabled = true
}
- Set the buildscript Repositories
Update the buildscript section in android/build.gradle to include additional repositories:
buildscript {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
maven { url "https://mobilesdk.mapsted.com:8443/artifactory/gradle-mapsted" }
}
}
Make sure to save your changes and sync your project with Gradle to apply these configurations.
IMPORTANT
- Add license file in Assets folder('/app/src/main/assets')
your_android_license.key
Example #
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
MyHomePageState createState() => MyHomePageState();
}
class MyHomePageState extends State<MyHomePage> {
final MapstedFlutter mapsted = MapstedFlutter();
Future<void> launchMapActivity() async {
try {
await mapsted.launchMapActivity();
} catch (e) {
print('Error launching map activity: $e');
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Mapsted Plugin Demo'),
),
body: Center(
child: ElevatedButton(
onPressed: launchMapActivity,
child: const Text("Launch Map"),
),
),
);
}
}
See example.dart linked example for more info.