Warm tip: This article is reproduced from serverfault.com, please click

alignment-颤动:将小部件对齐/固定到行的底部

(alignment - flutter: Align / pin widgets to bottom of row)

发布于 2020-12-08 15:16:44

如何将所有项目与Rowin flutter的底部对齐我有一个小部件,Row它在运行时会更改其高度,因此,其他所有小部件Row也会自动居中。我的问题是:如何防止这些其他小部件移动并将其固定在底部?

Questioner
larsaars
Viewed
0
Stefano A. 2020-12-08 23:30:32

你正在寻找的是CrossAxisAlignment

Row(
  crossAxisAlignment: CrossAxisAlignment.end,
  children: <Widget>[
    Container(width: 100, height: 200, color: Colors.red),
    Container(width: 100, height: 300, color: Colors.blue),
    SizedBox(
      width: 100,
      height: 150,
      child: FittedBox(
        fit: BoxFit.contain,
        child: const FlutterLogo(),
      ),
    ),
  ],
)