gyroscope_widget 1.0.0 copy "gyroscope_widget: ^1.0.0" to clipboard
gyroscope_widget: ^1.0.0 copied to clipboard

This library will allow you to move a little bit your widgets when you rotate your mobile phone.

example/lib/main.dart

import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Gyroscope Widget Demo',
      home: DemoPage(),
    );
  }
}

class DemoPage extends StatefulWidget {

  @override
  _DemoPageState createState() => _DemoPageState();
}

class _DemoPageState extends State<DemoPage> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        width: double.infinity,
        height: double.infinity,
        child: GyroscopeWidget(
          scaleMargin: 0.2,
          child: Image.network('https://picsum.photos/250?image=10',
            height: double.infinity,
            width: double.infinity,
            fit: BoxFit.fill,
          ),
        ),
      ),
    );
  }
}
3
likes
30
pub points
0%
popularity

Publisher

unverified uploader

This library will allow you to move a little bit your widgets when you rotate your mobile phone.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, sensors

More

Packages that depend on gyroscope_widget