首页 > 解决方案 > 如何防止 Flutter AppBar 菜单图标与 AppBar 中的滑块重叠?

问题描述

我对滑块的宽度有疑问,因为菜单与滑块有点重叠。如何编程滑块的自动宽度以防止重叠?

  appBar: AppBar(
    titleSpacing: 0,
    title: Row(
      mainAxisAlignment: MainAxisAlignment.start,
      children: <Widget>[
        IconButton(icon: Icon(Icons.brush)),
        IconButton(icon: Icon(Icons.undo)),
        IconButton(icon: Icon(Icons.redo)),
        Slider(value: x, min: 0, max: 100, divisions: 100),
      ],
    ),
    actions: <Widget>[
      PopupMenuButton<String>(
 ...

标签: flutter

解决方案


尝试在小部件之间添加 SizedBox(width: 10)


推荐阅读