shake 0.1.0 copy "shake: ^0.1.0" to clipboard
shake: ^0.1.0 copied to clipboard

outdated

A flutter package to detect phone shakes. Adjustable G-force and reset periods.

example/lib/main.dart

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

class DemoPage extends StatefulWidget {
  @override
  _DemoPageState createState() => _DemoPageState();
}

class _DemoPageState extends State<DemoPage> {
  @override
  void initState() {
    super.initState();
    ShakeDetector detector = ShakeDetector.autoStart(onPhoneShake: () {
      // Do stuff on phone shake
    });
    // To close: detector.stopListening();
    // ShakeDetector.waitForStart() waits for user to call detector.startListening();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold();
  }
}
199
likes
40
pub points
97%
popularity

Publisher

verified publisherjoshi.dev

A flutter package to detect phone shakes. Adjustable G-force and reset periods.

Repository

License

BSD-2-Clause (license)

Dependencies

flutter, sensors

More

Packages that depend on shake