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