gyro_provider 0.0.2 copy "gyro_provider: ^0.0.2" to clipboard
gyro_provider: ^0.0.2 copied to clipboard

A plugin that provides data from gyroscopes and rotation sensors and related handy widgets.

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            children: [
              GyroProvider(
                gyroscope: (vector) {
                  print(vector);
                },
                builder: (context, gyroscope, rotation) => Column(
                  children: [
                    const Text('gyroscope'),
                    Text(gyroscope.x.toString()),
                    Text(gyroscope.y.toString()),
                    Text(gyroscope.z.toString()),
                  ],
                ),
              ),
              const SizedBox(
                height: 100,
              ),
              GyroProvider.skew(
                verticalLock: true,
                child: Container(
                  color: Colors.red,
                  width: 100,
                  height: 100,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
6
likes
0
points
17
downloads

Publisher

unverified uploader

Weekly Downloads

A plugin that provides data from gyroscopes and rotation sensors and related handy widgets.

Homepage

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on gyro_provider

Packages that implement gyro_provider