animateToOffset method

Future<void> animateToOffset(
  1. double target
)

Implementation

Future<void> animateToOffset(double target) async {
  final double start = pullOffset.value;
  final motion = Get.isRegistered<MotionController>()
      ? Get.find<MotionController>()
      : null;
  final speed = motion?.speedMultiplier ?? 1.0;

  activeTween = Tween<double>(
    begin: start,
    end: target,
  ).chain(CurveTween(curve: Curves.easeOutCubic));

  resetController.duration = Duration(
    milliseconds: (300 / speed).round(),
  );
  resetController.reset();

  await resetController.forward();
}