When you break them down, the Flexible and Expanded widgets are quite beautiful in their simplicity.
The Expanded widget will take up all the remaining unconstrained space from a Row or a Column. In the preceding example, we placed three containers in the first row. The container was given a width of 100 units. The last container was given a width of 40 units. The middle container is wrapped in an Expanded widget, so it consumes all the remaining space in the row. These explicit values are referred to as constrained spacing.
The width calculation for the middle container would look like this:
These types of widgets can be very useful when you need to push widgets to the other edges of the screen, such as when you pushed the footer banner to the bottom of the screen:
Expanded(
child: Container(),
),
It is very common to create an Expanded widget with an empty container that will simply consume the remaining space in a...