DEV Community

Cover image for Expanded Vs Flexible in Flutter
OLUWAYEMI FISAYO NATHANIEL
OLUWAYEMI FISAYO NATHANIEL

Posted on

1

Expanded Vs Flexible in Flutter

Both Creates a widget that controls how a child of a [Row], [Column], or [Flex] flexes.

If you come from a CSS background, this is related to flexbox

The only difference between Expanded and Flexible is Expanded is Flexible that doesnt have a fit property

Example

Flexible:
Flexible(
flex: 3,
fit: FlexFit.tight,)

Expanded:
`Expanded(
flex: 3
//fit: FlexFit.tight,)

The fit property in Expanded is commented.

Both use flex the property

Top comments (1)

Collapse
 
nsilva1 profile image
Neto Ukpong

Thank you so much for this.

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay