Flutter: Expanded vs Flexible

Flutter provides Expand and Flexible Widget which work similar, but Expanded means to Expand (Cover) all Available Space and Flexible means to contains space that requires by child Widget. Here is the Basic Example :

Scaffold(
  appBar: AppBar(),
  body: Column(
    children: <Widget>[
      Row(
        children: <Widget>[
          buildExpanded(),
          buildFlexible(),
        ],
      ),
      Row(
        children: <Widget>[
          buildExpanded(),
          buildExpanded(),
        ],
      ),
      Row(
        children: <Widget>[
          buildFlexible(),
          buildFlexible(),
        ],
      ),
    ],
  ),
);

And Here is the output :

Flutter Expand vs Flexible Widget
Share

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *