awareframework_gravity 0.0.6 copy "awareframework_gravity: ^0.0.6" to clipboard
awareframework_gravity: ^0.0.6 copied to clipboard

The gravity sensor measures the force of gravity applied to the sensor built-in into the device and provides a three dimensional vector indicating the direction and magnitude of gravity

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:awareframework_gravity/awareframework_gravity.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> {

  GravitySensor sensor;
  GravitySensorConfig config;

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

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

    sensor = new GravitySensor.init(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 GravityCard(sensor: sensor,)
      ),
    );
  }
}
0
likes
20
pub points
0%
popularity

Publisher

unverified uploader

The gravity sensor measures the force of gravity applied to the sensor built-in into the device and provides a three dimensional vector indicating the direction and magnitude of gravity

Homepage

License

unknown (LICENSE)

Dependencies

awareframework_core, flutter

More

Packages that depend on awareframework_gravity