The ConstrainedBox Widget
Limit the size of a widget by setting width and height restrictions.
We'll cover the following...
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:
Both images represent the same Flutter application running on two different devices—a smartphone in portrait mode on the left, and a tablet in landscape mode on the right. The text fits the screen on the smartphone because the available width is limited. On the other hand, there is so much available width on the tablet version that the text becomes unreadable.
Constrain the width
Each widget in Flutter ...