flutter - 如何垂直缩短边框

标签 flutter

我想在垂直方向上缩短边框,我尝试了很多方法但都没有用,所以我想知道如何制作它。 我想得到这样的结果:

enter image description here

我的镜头是:

enter image description here

代码:

DecoratedBox(
vdecoration: new BoxDecoration(
   border: Border(left: BorderSide(color: 
  Theme.ColorsDari.colorGrey, width: 1.0,)),
    ),
    child: IconButton(
      icon: Icon(
        Icons.notifications,
        color: Theme.ColorsDari.colorGrey,
        size: 19,
      ),
      onPressed: () {
        print("your menu action here");
      },
   ),
  )

最佳答案

尝试这样的事情:

@override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(backgroundColor: Colors.orange),
      body: ListTile(
        trailing: Row(
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            Container(
              width: 1,
              height: 24,
              color: Colors.grey,
            ),
            SizedBox(width: 10),
            Icon(
              Icons.notifications,
              color: Colors.grey,
              size: 19,
            )
          ],
        ),
      ),
    );
  }

关于flutter - 如何垂直缩短边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56568343/

相关文章:

火力地堡, flutter : Can I check a validity of PhoneAuthCredential before signInWithCredential?

flutter - 如何在 Flutter 中的图像上添加水印文本?

flutter - 抖动-来自REST API的实时流数据

android - 类型 'Null' 不是类型 'Function' 的子类型

flutter - 是否建议根据显示大小设置字体大小?

flutter - 我在摄像头屏幕选项卡上时想隐藏应用程序栏和底部导航栏

flutter - 滚动行为中的 Text 和 ListView flutter

android - Android Gradle插件仅支持Kotlin Gradle插件1.3.10及更高版本

visual-studio-code - 如何为 Flutter 模拟器的 Visual Studio Code 设置设备

gridview - 根据flutter中的动态内容调整GridView子高度