animateWidgetMagnetic method

Widget animateWidgetMagnetic({
  1. int durationMs = 550,
  2. bool repeat = false,
  3. bool animate = true,
})
  1. Magnetic Pull

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);
}