导航到下一个屏幕后,如何保持appbar标题中心。当我导航到下一个屏幕时,会出现后退箭头按钮"<",将标题向右移动。如何保持标题居中?我尝试了centerTitle=True,但不起作用
appBar: AppBar(
centerTitle: true,
backgroundColor: Colors.teal,
title: Center(
child: Text(
kAppBarTitle,
),
),
),
如果使用centerTitle: true
,请不要在title
参数中使用Center
小部件。
appBar: AppBar(
centerTitle: true,
backgroundColor: Colors.teal,
title: Text(
kAppBarTitle,
),
),
这就是你需要解决的全部问题。