This Flutter project demonstrates how to use the device's shaking motion (captured through the accelerometer) to create an animated circle on the screen. The circle's movement and animation are driven by the shaking gesture, allowing the user to interact with the animation by shaking the device. The project leverages Flutter's CustomPainter
and explicit animations for smooth, dynamic visuals.
In this project:
- Shaking Detection: The device’s accelerometer is used to detect shaking movements. When the device is shaken, it triggers an animation.
- Custom Painting: A custom painter is used to draw a circle that responds to the shake input.
- Explicit Animations: Flutter’s
AnimationController
andTween
are used for smooth animations of the circle's movement and size when a shake is detected.
Screenshot |
---|