awareframework_locations 0.0.3 awareframework_locations: ^0.0.3 copied to clipboard
A new flutter plugin project.
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:awareframework_locations/awareframework_locations.dart';
void main() => runApp(new MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => new _MyAppState();
}
class _MyAppState extends State<MyApp> {
String _platformVersion = 'Unknown';
var config;
var sensor;
@override
void initState() {
super.initState();
initPlatformState();
}
// Platform messages are asynchronous, so we initialize in an async method.
Future<void> initPlatformState() async {
config = LocationSensorConfig();
config
..frequencyGps = 1.0
..debug = true
..dbType = 1;
sensor = LocationSensor(config);
sensor.start();
}
@override
Widget build(BuildContext context) {
return new MaterialApp(
home: new Scaffold(
appBar: new AppBar(
title: const Text('Plugin example app'),
),
body: LocationCard(sensor: sensor),
),
);
}
}