motion
2.0.3, released 4 weeks ago by cendre.me
Applies a gyroscope or hover-based motion effect to Flutter widgets.
What it does
The package provides a Motion widget that applies a gyroscope-based tilt effect to its child on mobile platforms, and a hover-based effect on web or desktop. It supports customizable elevation, shadow, and glare effects with damping options.
AI-written summary of version 2.0.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to add 3D-like gyroscope tilt effects to cards or UI components.
- You want pointer-based hover motion effects for web or desktop targets.
Skip it when
- You are targeting environments where device motion sensors or pointer events are not suitable.
- You need standard physics-based animations or layout transitions.
Strengths
- Supports both gyroscope and hover events seamlessly.
- Provides customizable configurations for shadows, elevation, glare, and damping.
Weaknesses
- Requires explicit initialization before running the Flutter app.
- Safari iOS has specific permission and gradient rendering limitations.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
Initialize the plugin at Dart runtime using Motion.instance.initialize() before running the app.
Future<void> main() async {
await Motion.instance.initialize();
runApp(const MyApp());
}
// Inside your widget:
Motion(child: myWidget);Alternatives
Packages that do the same job and could replace motion.
- flutter_animate
If you need a general-purpose animation library for timeline and effect sequencing rather than sensor-driven motion.
70Compare
Works with
Packages commonly used together with motion: ones it builds on, ones built on it, and its own family.