shake_detector_android 0.0.4 copy "shake_detector_android: ^0.0.4" to clipboard
shake_detector_android: ^0.0.4 copied to clipboard

PlatformAndroid

The shake_detector_android is a Flutter plugin that allows your application to detect shake events using the device's accelerometer.

example/lib/main.dart

import 'dart:developer';

import 'package:flutter/material.dart';
import 'package:shake_detector_android/shake_detector_android.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
  void initState() {
    super.initState();
    ShakeDetectorAndroid.startListening((e) {
      //Do Something Here
      // print("TYPE OF SHAKE :- $e");
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Shake Detector example app'),
        ),
        body: const Center(
          child: Text('Shake Detector'),
        ),
      ),
    );
  }
}
4
likes
155
points
34
downloads

Publisher

unverified uploader

Weekly Downloads

The shake_detector_android is a Flutter plugin that allows your application to detect shake events using the device's accelerometer.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on shake_detector_android

Packages that implement shake_detector_android