AppBar
页面的导航条区域,示例代码如下:
appBar: AppBar(
// 标题
title: Text('页面标题'),
// 标题是否居中显示
centerTitle: true,
// 右侧的按钮
actions: <Widget>[
Padding( // 为 IconButton 添加右 padding 为 10px
padding: EdgeInsets.only(right: 10),
child: IconButton( // 右侧的搜索按钮
icon: Icon(Icons.search),
onPressed: () {},
),
)
],
)