Flutter 通过组合布局 widget 来构建布局 — 例如 Row、Column、Container、Stack 等 — 这些 widget 会排列它们的子元素。理解这些布局 widget 以及它们如何组合对于创建 UI 结构至关重要。
核心布局 widget
ROW → arrange children HORIZONTALLY (left to right)
COLUMN → arrange children VERTICALLY (top to bottom)
CONTAINER → a box: padding, margin, size, color, decoration, alignment (very common)
STACK → overlay children on top of each other (z-axis, positioned)
PADDING → add space around a child
CENTER → center a child
EXPANDED / FLEXIBLE → make children fill available space (in a Row/Column)
SizedBox → fixed-size box / spacing
ListView → scrollable list of children
