createAnimate method

void createAnimate(
  1. double start,
  2. double end
)

Implementation

void createAnimate(double start, double end) {
  transform = Tween<double>(begin: start, end: end)
      .animate(CurvedAnimation(parent: controller!, curve: Curves.linear))
    ..addListener(() {
      setState(() {
        if (-(_maxLeft - 1) >= transform.value) {
          _left = _boxWidth;
          createAnimate(_boxWidth, -_maxLeft);
        } else {
          _left = transform.value;
        }
      });
    });
}