flutter_slam_sdk 0.0.1
flutter_slam_sdk: ^0.0.1 copied to clipboard
A Flutter wrapper for the Combain Slam SDK.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:flutter_slam_sdk/flutter_slam_sdk.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
String _lat = "...";
late FlutterSlamSDK _flutterSlamSDKPlugin;
@override
void initState() {
super.initState();
initPlatformState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Text('Lat is: $_lat\n'),
),
),
);
}
void initPlatformState() {
_flutterSlamSDKPlugin = FlutterSlamSDK("4c51791a0cdbd2dc91e1eb5d1371b183b7e95686ce0bc53f2d68c4d61f9d865b");
_flutterSlamSDKPlugin.addLocationUpdateListener((location) {
setState(() {
_lat = location.latitude.toString();
});
});
_flutterSlamSDKPlugin.start();
}
}