animateListPaperLift method

Widget animateListPaperLift({
  1. required int index,
  2. int intervalMs = 100,
  3. int durationMs = 600,
  4. bool animate = true,
})
  1. Paper Slide & Lift

Implementation

Widget animateListPaperLift({
  required int index,
  int intervalMs = 100,
  int durationMs = 600,
  bool animate = true,
}) {
  if (!animate) return this;
  return this
      .animate(delay: _getDelay(index, intervalMs).ms)
      .fadeIn(duration: 300.ms)
      .slideY(
        begin: 0.5,
        end: 0,
        curve: Curves.easeOutQuart,
        duration: durationMs.ms,
      )
      .custom(
        begin: 10,
        end: 0,
        duration: durationMs.ms,
        builder:
            (_, v, c) => Transform.translate(
              offset: Offset(0, -v),
              child: PhysicalModel(
                color: Colors.white,
                shadowColor: Colors.black.withValues(alpha: v > 0 ? 0.1 : 0),
                elevation: v,
                borderRadius: BorderRadius.circular(12),
                child: c,
              ),
            ),
      );
}