DEV Community

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

Posted on

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.