shake_gesture 1.0.5 copy "shake_gesture: ^1.0.5" to clipboard
shake_gesture: ^1.0.5 copied to clipboard

Provides a widget to detect shake gestures. It allows you to easily add shake detection to your Flutter app on Android and iOS.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:shake_gesture/shake_gesture.dart';
import 'package:shake_gesture_test_helper/shake_gesture_test_helper.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(home: HomePage());
  }
}

class HomePage extends StatelessWidget {
  const HomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('ShakeGesture Example')),
      body: Center(
        child: ShakeGesture(
          onShake: () {
            ScaffoldMessenger.of(context).showSnackBar(
              const SnackBar(content: Text('Shake!')),
            );
          },
          child: const Center(
            child: OutlinedButton(
              onPressed: ShakeGestureTestHelperExtension.simulateShake,
              child: Text('Simulate Shake'),
            ),
          ),
        ),
      ),
    );
  }
}
6
likes
160
pub points
87%
popularity

Publisher

verified publisherthomaspucci.com

Provides a widget to detect shake gestures. It allows you to easily add shake detection to your Flutter app on Android and iOS.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, shake_gesture_android, shake_gesture_ios, shake_gesture_platform_interface

More

Packages that depend on shake_gesture