hi guys I just started learning flutter animation and using flutter curves from flutter curve website using tween value which goes like
_animation = Tween<double>(begin: -100, end: 0).animate(
CurvedAnimation(
parent: _controller,
curve: Curves.bounceInOut,
),
);)
i want to animate this in stack with the circular container with positioned widget using Animated builder code is likke this
Stack(
children: [
// background image view
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage('images/sky.webp'), fit: BoxFit.cover),
),
),
//! I want to animate this like a bouncing ball
AnimatedBuilder(
animation: _controller,
builder: (context, child) {
return Positioned(
// This is the animation value as position of the circular container
bottom: _animation.value,
left: _animation.value + 50,
child: Container(
height: 250,
width: 250,
decoration: const BoxDecoration(
shape: BoxShape.circle,
// borderRadius: BorderRadius.only(
// topLeft: Radius.circular(15),
// topRight: Radius.circular(15),
// ),
image: DecorationImage(
image: AssetImage(
'images/colz.jpg',
),
fit: BoxFit.cover,
),
),
),
);
},
)
],
),
I want bounce direction as
from here start curve for bounceinout
--^
^---- > here the curve ends
this what happenens after the code


I think you may be better served by having two different animations that share the same controller to drive them. The controller to adjust the horizontal direction could be a different curve than the one that adjusts the horizontal direction.
I've modified your original code to do this, as well as added an example for how you might go about making your own curve that could give you that springiness that you want. Note that the demo curves I have at the bottom are very rough and can be janky if not paired up with linear primary curves. You could make them smoother by possibly averaging the starting and ending points of each curve - I will leave that up to you to modify.
Also note that I swapped your Positioned widget for an Align widget; I think Align may be what you want- Positioned in order to get it to move across the screen would require some MediaQuery.of(context).size calls to properly scale it to the screen, whereas Align will just keep it on the screen.
And I obviously didn't have your images, so you'd need to add those back.