TweenSequence animation only goes half way

Viewed 75

For my widget the animation I have is going down half way because I am using this:

       TweenSequenceItem<Alignment>(
          tween: AlignmentTween(
              begin: Alignment.topCenter, end: Alignment.bottomCenter),
          weight: 1.0),

I have determined when using topCenter to bottomCenter it seems to traverse down half way when the animation is running.

Result:

enter image description here

What I want it to do is to go down all the way on the screen, would I specify coordinates for that? If that is the way how would those coordinates beceome dynamic across different screen sizes?

Code:

class _BouncingBallState extends State<BouncingBall>
    with TickerProviderStateMixin {
  AnimationController controller;
  Animation<Alignment> alignmentAnimation; // Create animation object

  void initState() {
    super.initState();
    controller = AnimationController(
      vsync: this,
      duration: Duration(seconds: 60),
    );

    controller.repeat(); // Make animation repeat

    // Initialize using TweenSequence, that contains TweenSequenceItem, we can add multiple TweenSequenceItem as per our animation requirement
    alignmentAnimation = TweenSequence<Alignment>([
      // First point move from top center to bottom center
      TweenSequenceItem<Alignment>(
          tween: AlignmentTween(
              begin: Alignment.topCenter, end: Alignment.bottomCenter),
          weight: 1.0),
}
0 Answers
Related