Post

Just had one of those ‘reinventing the wheel’ moments in Flutter: 🤯 Did you know that Spacer is literally just an Expanded with a SizedBox.shrink as its child? That’s it. I never thought about how simple its implementation could be until I checked the source code.

0 reposts8 likes

Essentially, Spacer uses Expanded to occupy flexible space in a Row, Column, or Flex, and the SizedBox.shrink ensures it doesn’t take up any visual space. Simple and brilliant.

I’m amazed by how much you can achieve in Flutter by combining basic widgets. It’s like the entire framework is designed to encourage creativity with minimal building blocks.

If you already knew this, just pretend you didn’t and let me enjoy my 'discovery moment' 😅😂 What about you? Are there other widgets with equally simple implementations that I’m overlooking? 👀