animateWidgetFloatWithShadow method

Widget animateWidgetFloatWithShadow({
  1. int durationMs = 1500,
  2. Color shadowColor = Colors.black,
  3. bool repeat = true,
  4. bool animate = true,
})
  1. Float with Shadow

Implementation

Widget animateWidgetFloatWithShadow({
  int durationMs = 1500,
  Color shadowColor = Colors.black,
  bool repeat = true,
  bool animate = true,
}) {
  if (!animate) return this;
  return _baseAnimate(repeat: repeat, reverse: true)
      .moveY(
        begin: 0,
        end: -10,
        duration: durationMs.ms,
        curve: Curves.easeInOut,
      )
      .custom(
        duration: durationMs.ms,
        builder:
            (_, v, c) => Container(
              decoration: BoxDecoration(
                boxShadow: [
                  BoxShadow(
                    color: shadowColor.withColorOpacity(0.1 * (1 - v)),
                    blurRadius: 10 * v,
                    offset: Offset(0, 15 * v),
                  ),
                ],
              ),
              child: c,
            ),
      );
}