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