【发布时间】:2019-11-14 19:36:46
【问题描述】:
我想把“Logo2”小部件放在左边,而“Title logo”放在中间。我尝试在行内使用扩展,并使用堆栈,但我无法当场得到它。我还需要它在不同的屏幕尺寸上工作。
当前代码:
appBar: AppBar(
leading: Icon(Icons.menu),
centerTitle: true,
title: Container(child: Row(
children: <Widget>[
Expanded(flex:2, child: Text("Logo 2")),
Expanded(flex:4, child: Text("Title logo")),
],
)),
actions: <Widget>[
IconButton(
icon: Icon(Icons.person_pin),
onPressed: (){},
)
],
),
【问题讨论】:
-
我认为如果
centerTile为假,该行将起作用。 -
不会改变任何东西。