Flutter layout uses constraints flow down, sizes flow up.
Container(width: 300)
↓ constraint
Child (cannot exceed 300)
BoxConstraints(
minWidth
maxWidth
minHeight
maxHeight
)
minWidth: 0
maxWidth: 300
minHeight: 0
maxHeight: 100
Row gives unbounded width to children.
So sometimes see error: RenderFlex overflowed
Fix using:
Expanded
Flexible
SizedBox
Example:
Row(
children: [
Expanded(child: Text("Hello")),
Text("World")
]
)