首页 > 解决方案 > 我们可以通过 Trailing 或 SizedBox 在 AppBar 的右侧添加 Icons 吗?为什么和为什么不?

问题描述

在此处输入图像描述为什么我不能使用行、尾随和大小的框部分?

标签: androidflutterdartflutter-layout

解决方案


考虑使用AppBar actionslike

Scaffold(
      appBar: AppBar(
        actions: [Icon(Icons.ac_unit)], ///here
      ),
      body: Text("Body"),
    );

AppBar概述

有关AppBar的更多信息


推荐阅读