如何在Appbar左侧创建按钮[flutter]
我试图在应用程序栏的左侧制作按钮[弹出新屏幕],但我发现只有抽屉不是我想要的。
我在 AppBar 中想要什么:
------------------------------------------------<br>
| button |----------text----------| button |<br>
------------------------------------------------<br>
我现在所拥有的:
------------------------------------------------<br>
----------------text----------------| button | <- form actions in AppBar<br>
------------------------------------------------<br>
回答
如果我理解正确,您想在AppBar. 您可以通过使用该leading属性来实现这一点,如下所示:
AppBar(
title: Text("AppBar with leading button"),
automaticallyImplyLeading: false,
leading: IconButton (
icon: Icon(Icons.arrow_back),
onPressed: () {
/** Do something */
},
),
)