AppBar

页面的导航条区域,示例代码如下:

  1. appBar: AppBar(
  2. // 标题
  3. title: Text('页面标题'),
  4. // 标题是否居中显示
  5. centerTitle: true,
  6. // 右侧的按钮
  7. actions: <Widget>[
  8. Padding( // 为 IconButton 添加右 padding 为 10px
  9. padding: EdgeInsets.only(right: 10),
  10. child: IconButton( // 右侧的搜索按钮
  11. icon: Icon(Icons.search),
  12. onPressed: () {},
  13. ),
  14. )
  15. ],
  16. )