animateWidgetLiquidFill method
Widget
animateWidgetLiquidFill(
{ - Color color = Colors.greenAccent,
- int durationMs = 3000,
- bool repeat = true,
- bool animate = true,
})
- Liquid Fill Breathe (Loop)
Implementation
Widget animateWidgetLiquidFill(
{Color color = Colors.greenAccent,
int durationMs = 3000,
bool repeat = true,
bool animate = true}) {
if (!animate) return this;
return _baseAnimate(repeat: repeat, reverse: true).custom(
duration: durationMs.ms,
builder: (_, v, child) => ShaderMask(
shaderCallback: (rect) => LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [color, Colors.transparent],
stops: [v, v + 0.1],
).createShader(rect),
blendMode: BlendMode.srcATop,
child: child,
),
);
}