flash static method
闪烁动画
Implementation
static AnimatedBuilder flash(Animation<double> animation, Widget child) {
return AnimatedBuilder(
animation: animation,
builder: (context, child) {
final opacity =
animation.value > 0.5 ? 1.0 - animation.value : animation.value;
return Opacity(opacity: opacity, child: child);
},
child: child,
);
}