We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using AnimateWidget, you can specify for each animate value, its onw curve and reverseCurve using setCurve and setReverseCurve.
AnimateWidget
curve
reverseCurve
setCurve
setReverseCurve
This is the same example as in Flutter docs for staggered animation:
class _MyStaggeredWidgetState extends State<MyStatefulWidget> { @override Widget build(BuildContext context) { return GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { setState(() {}); }, child: AnimateWidget( duration: const Duration(milliseconds: 2000), cycles: 2, triggerOnRebuild: true, triggerOnInit: false, builder: (context, animate) { final padding = animate .setCurve(Interval(0.250, 0.375, curve: Curves.ease)) .fromTween( (_) => EdgeInsetsTween( begin: const EdgeInsets.only(bottom: 16.0), end: const EdgeInsets.only(bottom: 75.0), ), ); final opacity = animate .setCurve(Interval(0.0, 0.100, curve: Curves.ease)) .fromTween( (_) => Tween<double>(begin: 0.0, end: 1.0), )!; final containerWidget = animate .setCurve(Interval(0.125, 0.250, curve: Curves.ease)) .fromTween( (_) => Tween<double>(begin: 50.0, end: 150.0), 'width', )!; final containerHeight = animate .setCurve(Interval(0.250, 0.375, curve: Curves.ease)) .fromTween( (_) => Tween<double>(begin: 50.0, end: 150.0), 'height', )!; final color = animate .setCurve(Interval(0.500, 0.750, curve: Curves.ease)) .fromTween( (_) => ColorTween( begin: Colors.indigo[100], end: Colors.orange[400], ), ); final borderRadius = animate .setCurve(Interval(0.375, 0.500, curve: Curves.ease)) .fromTween( (_) => BorderRadiusTween( begin: BorderRadius.circular(4.0), end: BorderRadius.circular(75.0), ), ); return Center( child: Container( width: 300.0, height: 300.0, decoration: BoxDecoration( color: Colors.black.withOpacity(0.1), border: Border.all( color: Colors.black.withOpacity(0.5), ), ), child: Container( padding: padding, alignment: Alignment.bottomCenter, child: Opacity( opacity: opacity, child: Container( width: containerWidget, height: containerHeight, decoration: BoxDecoration( color: color, border: Border.all( color: Colors.indigo[300]!, width: 3.0, ), borderRadius: borderRadius, ), ), ), ), ), ); }, ), ); } }
Here is the full working example.
One of the particularities of Animator is that you can use staggered animation with implicitly animated widget. Here is the above example with implicit staggered animation
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Staggered Animation
Using
AnimateWidget
, you can specify for each animate value, its onwcurve
andreverseCurve
usingsetCurve
andsetReverseCurve
.This is the same example as in Flutter docs for staggered animation:
Here is the full working example.
One of the particularities of Animator is that you can use staggered animation with implicitly animated widget. Here is the above example with implicit staggered animation
The text was updated successfully, but these errors were encountered: