awareframework_gyroscope 0.7.0 copy "awareframework_gyroscope: ^0.7.0" to clipboard
awareframework_gyroscope: ^0.7.0 copied to clipboard

The Gyroscope Sensor allows us to retrieve data from the onboard gyroscopes.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:awareframework_gyroscope/awareframework_gyroscope.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> {
  GyroscopeSensor? sensor;
  GyroscopeSensorConfig? config;

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

    config = GyroscopeSensorConfig()
      ..frequency = 100
      ..dbType = DatabaseType.DEFAULT
      ..debug = true;

    sensor = new GyroscopeSensor.init(config!);
    sensor?.start();
    sensor?.onDataChanged.listen((data) {
      print(data);
    });
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Plugin Example App'),
        ),
      ),
    );
  }
}
0
likes
130
points
24
downloads

Publisher

unverified uploader

Weekly Downloads

The Gyroscope Sensor allows us to retrieve data from the onboard gyroscopes.

Documentation

API reference

License

unknown (license)

Dependencies

awareframework_core, flutter

More

Packages that depend on awareframework_gyroscope

Packages that implement awareframework_gyroscope