title: Flutter Icons in Row "right overflowed by X pixels"
body: <p>I am trying to build a Tab Bar in Flutter animate it closing and opening. While it's opening, because the icons inside a Row are only fully visible once the Row is extended, it gives me the famous Flutter &quot;overflowed&quot; error.</p>
  <p>I tried reading about possible solutions, but most are connected to text overflow issues. I've tried wrapping my Row in an &quot;Expanded&quot;, but I realized it doesn't make much sense anyway. I had a look at other solutions, but I cannot find anything similar to my issue with Icons in a Row widget.</p>
  <p>I hope someone can help me and hopefully this helps someone in the future.</p>
  <pre><code>  bool selected = false;
    @override
    Widget build(BuildContext context) {
      return GestureDetector(
        onTap: () {
          setState(() {
            selected = !selected;
          });
        },
        child: Center(
          child: AnimatedContainer(
            padding: selected ? EdgeInsets.symmetric(vertical: 12.0, horizontal: 12.0) :
            EdgeInsets.symmetric(vertical: 12.0, horizontal: 30.0),
            width: selected ? 48 : MediaQuery.of(context).size.width * 0.85,
            child: selected ? Row(
              children: [
                Icon(Icons.favorite),
              ],
            )
                : Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Icon(Icons.home),
                Icon(Icons.message),
                Icon(Icons.add),
                Icon(Icons.shopping_cart),
                Icon(Icons.person_outline),
              ],
            ),
            decoration: BoxDecoration(
                color: Colors.grey, borderRadius: BorderRadius.circular(30)),
            duration: Duration(seconds: 1),
            curve: Curves.fastOutSlowIn,
          ),
        ),
      );
    }
  }```
  
  [Fig.1][1]
  
  Fig. 1
  
  [Fig.2][2]
  
  Fig. 2
  
  
    [1]: https://i.stack.imgur.com/hkjPM.jpg
    [2]: https://i.stack.imgur.com/nnDTi.jpg
  </code></pre>