title: Flutter animations: how to keep position of parent widget
body: <p>I'm having some trouble with an animation in Flutter.
  There are 3 circles next to each other. When one of them is pressed, I want it to expand and collapse. The animation works, but the whole row of circles moves downward when it happens, to keep the top margin of the row the circles are in. How do I make sure the row keeps it original position?</p>
  
  <p>I've only applied the animation to the center circle to test it. I'm sorry if the code is messy, it's because I was testing this. This is the animation and animation controller:</p>
  
  <pre><code>    _animationController =
          AnimationController(vsync: this, duration: Duration(milliseconds: 200));
      _animation = Tween(begin: 0.25, end: 0.35).animate(
          CurvedAnimation(parent: _animationController, curve: Curves.elasticIn))
        ..addStatusListener((status) {
          if (status == AnimationStatus.completed) {
            _animationController.reverse();
          }
        });
  </code></pre>
  
  <p>These are the circles: </p>
  
  <pre><code>Column(
          children: &lt;Widget&gt;[
  Container(
              margin: EdgeInsets.only(top: 16.0),
              child: Center(
                child: Text(
                  'Circles',
                  style: TextStyle(fontSize: 18),
                ),
              ),
            ),
  Container(
              margin: EdgeInsets.only(top: 8.0),
              child: Row(
                mainAxisSize: MainAxisSize.min,
                children: &lt;Widget&gt;[
                  Container(
                    width: MediaQuery.of(context).size.width * 0.25,
                    height: MediaQuery.of(context).size.height * 0.2,
                    margin: EdgeInsets.symmetric(horizontal: 8.0),
                    child: Center(child: Text('Circle')),
                    decoration: BoxDecoration(
                        shape: BoxShape.circle,
                        border: Border.all(color: AppColors.primaryBlue)),
                  ),
                  AnimatedBuilder(
                    animation: _animation,
                    builder: (context, child) {
                      return GestureDetector(
                        onTap: () {
                          _animationController.forward();
                        },
                        child: Container(
                          width: MediaQuery.of(context).size.width *
                              _animation.value,
                          height: MediaQuery.of(context).size.height *
                              _animation.value,
                          margin: EdgeInsets.symmetric(horizontal: 8.0),
                          child: Center(child: Text('Circle')),
                          decoration: BoxDecoration(
                              shape: BoxShape.circle,
                              border: Border.all(color: AppColors.primaryBlue)),
                        ),
                      );
                    },
                  ),
                  Container(
                    width: MediaQuery.of(context).size.width * 0.25,
                    height: MediaQuery.of(context).size.height * 0.2,
                    margin: EdgeInsets.symmetric(horizontal: 8.0),
                    child: Center(child: Text('Circle')),
                    decoration: BoxDecoration(
                        shape: BoxShape.circle,
                        border: Border.all(color: AppColors.primaryBlue)),
                  )
                ],
              ),
            ),
  </code></pre>
  
  <p>You can probably notice I'm quite new to animations in Flutter, so other feedback is very welcome too. Thanks!</p>