shakeY static method
Y轴抖动动画
Implementation
static AnimatedBuilder shakeY(Animation<double> animation, Widget child) {
return AnimatedBuilder(
animation: animation,
builder: (context, child) {
final dy = sin(animation.value * pi * 10) * 10;
return Transform.translate(offset: Offset(0, dy), child: child);
},
child: child,
);
}