animateWidgetMagnetic method
Widget
animateWidgetMagnetic(
{ - int durationMs = 550,
- bool repeat = false,
- bool animate = true,
})
Implementation
Widget animateWidgetMagnetic({
int durationMs = 550,
bool repeat = false,
bool animate = true,
}) {
if (!animate) return this;
return _baseAnimate(repeat: repeat)
.scale(
begin: const Offset(1, 1),
end: const Offset(0.92, 0.92),
duration: 150.ms,
curve: Curves.easeOut,
)
.then()
.scale(
begin: const Offset(0.92, 0.92),
end: const Offset(1, 1),
duration: 400.ms,
curve: Curves.elasticOut,
);
}