awareframework_linearaccelerometer 0.0.4 copy "awareframework_linearaccelerometer: ^0.0.4" to clipboard
awareframework_linearaccelerometer: ^0.0.4 copied to clipboard

A new flutter plugin project.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:awareframework_linearaccelerometer/awareframework_linearaccelerometer.dart';
import 'package:awareframework_core/awareframework_core.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {

  LinearAccelerometerSensor sensor;
  LinearAccelerometerSensorConfig config;

  @override
  void initState() {
    super.initState();

    config = LinearAccelerometerSensorConfig()
      ..frequency = 100
      ..dbType = 1
      ..debug = true;

    sensor = new LinearAccelerometerSensor(config);

    sensor.start();

  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
          appBar: new AppBar(
            title: const Text('Plugin Example App'),
          ),
          body: new LinearAccelerometerCard(sensor: sensor,)
      ),
    );
  }
}
0
likes
20
pub points
0%
popularity

Publisher

unverified uploader

A new flutter plugin project.

Homepage

License

unknown (LICENSE)

Dependencies

awareframework_core, flutter

More

Packages that depend on awareframework_linearaccelerometer