The ConstrainedBox Widget

Limit the size of a widget by setting width and height restrictions.

The Flutter framework does a good job of sizing and placing our widgets. However, sometimes we need to change the widget’s size because the framework calculation doesn’t fit our needs. Let’s take look at an example:

Get hands-on with 1200+ tech skills courses.