scroll method

void scroll()

Implementation

void scroll() async {
  while (true) {
    if (scrollController.hasClients) {
      await Future.delayed(pauseDuration);
      if (scrollController.hasClients) {
        await scrollController.animateTo(
            scrollController.position.maxScrollExtent,
            duration: animationDuration,
            curve: Curves.easeIn);
      }
      await Future.delayed(pauseDuration);
      if (scrollController.hasClients) {
        switch (directionMarguee) {
          case DirectionMarguee.oneDirection:
            scrollController.jumpTo(
              0.0,
            );
            break;
          case DirectionMarguee.twoDirection:
            await scrollController.animateTo(0.0,
                duration: backDuration, curve: Curves.easeOut);
            break;
        }
      }
    } else {
      await Future.delayed(pauseDuration);
    }
  }
}