Flutter: Expanded vs Flexible

user6274128 picture user6274128 · Oct 4, 2018 · Viewed 66.7k times · Source

I've used both Expanded and Flexible widgets and they seem to work same.

What is the difference between Expanded and Flexible?

Answer

Raouf Rahiche picture Raouf Rahiche · Oct 20, 2018
Scaffold(
  appBar: AppBar(),
  body: Column(
    children: <Widget>[
      Row(
        children: <Widget>[
          buildExpanded(),
          buildFlexible(),
        ],
      ),
      Row(
        children: <Widget>[
          buildExpanded(),
          buildExpanded(),
        ],
      ),
      Row(
        children: <Widget>[
          buildFlexible(),
          buildFlexible(),
        ],
      ),
    ],
  ),
);

enter image description here