title: How to animate conditionally rendered widgets in Flutter
body: <p>I am adding a widget to build tree conditionally, now how can I animate displaying and hiding when <strong>isPlaying</strong> changes?:</p>
  
  <pre><code>...
  if (isPlaying)
                      Padding(
                        padding: EdgeInsets.all(8),
                        child: Container(
                          decoration: BoxDecoration(
                            color: Color.fromARGB(200, 255, 255, 255),
                            border: Border.all(
                              color: buttonStroke,
                              width: 1.3,
                            ),
                            borderRadius: BorderRadius.all(Radius.circular(12)),
                          ),
                          child: _buildPlayer(),
                        ),
                      ),
  </code></pre>