animateWidgetErrorShake method
Widget
animateWidgetErrorShake(
{ - required bool trigger,
- Color color = Colors.red,
- bool repeat = false,
- bool animate = true,
})
Implementation
Widget animateWidgetErrorShake(
{required bool trigger,
Color color = Colors.red,
bool repeat = false,
bool animate = true}) {
if (!animate || !trigger) return this;
return _baseAnimate(repeat: repeat).shakeX(hz: 10, duration: 500.ms).custom(
duration: 500.ms,
builder: (_, v, c) => Container(
decoration: BoxDecoration(boxShadow: [
BoxShadow(
color: color.withColorOpacity(0.2 * (1 - v)), blurRadius: 10)
]),
child: c,
),
);
}