Flutter - Getting started
Getting started
A Flutter plugin to display wemap's livemap.
Installation
- Create new flutter application
flutter create sample_flutter_wemap_sdk && cd sample_flutter_wemap_sdk
- Add flutter_wemap_sdk plugin to your pubspec.yaml
dependencies
:
flutter_wemap_sdk:
git:
url: https://github.com/wemap/flutter_wemap_sdk.git
ref: master
iOS
- update
Podfile
use_frameworks! :linkage => :static
use_modular_headers!
pod 'livemap-ios-sdk', :git => 'git@github.com:wemap/livemap-ios-sdk.git', :branch => 'master'
platform :ios, '11.0'
- install
cd ios/ && pod install
Android
- add
compileSdkVersion 33
to your app'sbuild.gradle
(android/app/build.gradle
)
Usage
- instanciate && return
Livemap
fromemmid
&token
class MyHomePage extends StatelessWidget {
final String title;
const MyHomePage({super.key, required this.title});
@override
Widget build(BuildContext context) {
const Map<String, dynamic> creationParams = <String, dynamic>{
"token": "GUHTU6TYAWWQHUSR5Z5JZNMXX",
"emmid": 22418
};
return Scaffold(
appBar: AppBar(title: Text(title)),
body: Container(
constraints: const BoxConstraints.expand(),
child: const Livemap(options: creationParams)));
}
}
- use controller & subscribes to event:
see example/
events:
onMapReady
onPinpointOpen
onPinpointClose
onContentUpdated
onIndoorLevelChanged
onIndoorLevelsChanged
onMapClick
methods:
openPinpoint
closePinpoint
setCenter
centerTo
easeTo
setIndoorFeatureState
setZoom