animated_box_decoration
0.0.8, released 5 weeks ago by wenkaifan.com
Smoothly animate between any two BoxDecoration including colors, gradients, and images.
What it does
Provides a SmoothAnimatedContainer and SmoothDecorationTween to transition between complex BoxDecoration instances. It handles transitions between colors and gradients, different gradient types, and images where default Flutter widgets fall short.
AI-written summary of version 0.0.8, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to animate between a color background and a gradient background
- You need to animate background images smoothly in a container
- You want a drop-in alternative to AnimatedContainer for complex decorations
Skip it when
- You need to animate container shapes (like morphing shapes)
- You are using a version of Flutter older than 3.27
Strengths
- Supports transitions between colors, different gradient types, and images
- Works out of the box with Material, Cupertino, or headless apps using only widgets
- Fixes various animation jump and interruption bugs present in default implementations
Weaknesses
- Does not implement the animation of container shapes
- Requires Flutter 3.27 or newer
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
SmoothAnimatedContainer(
duration: const Duration(seconds: 1),
width: 200,
height: 200,
decoration: toggled ? decoration1 : decoration2,
)Alternatives
Packages that do the same job and could replace animated_box_decoration.
- flutter_animate
For general-purpose animation effects and declarative chains across multiple widget properties.
70Compare
Works with
Packages commonly used together with animated_box_decoration: ones it builds on, ones built on it, and its own family.