spring_button
2.0.0, released 6 years ago by cosmossoftware.coffee
A simple widget for having child widgets that respond to gestures with a spring animation.
WASM-ready
What it does
SpringButton wraps a child widget and extends functionality similar to a GestureDetector, adding spring physics animations upon user interaction. It supports multiple gesture callbacks and customization parameters like scale coefficient and duration.
AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want child widgets or buttons to give physical spring-like feedback upon touch gestures.
- You need a drop-in replacement for GestureDetector that includes built-in spring animations.
Skip it when
- You need complex physics-based multi-element animations handled via Rive or full game engines.
- You need complex declarative page transitions.
Strengths
- Familiar API closely mirroring standard Flutter GestureDetector.
- Supports null safety and a wide range of gesture callbacks.
Weaknesses
- Limited to spring scaling animations on touch rather than arbitrary physics-based motion.
- Author notes it was built early in their Flutter learning journey.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
SpringButton(
SpringButtonType.OnlyScale,
uiChild(),
scaleCoefficient: 0.75,
duration: 1000,
onTap: () {},
)Alternatives
Packages that do the same job and could replace spring_button.
- flutter_animate
For general-purpose declarative animations and effects applied to widgets.
70Compare - rive
For advanced interactive vector animations and rich motion graphics.
89Compare