首页 > 解决方案 > How to shorten the border vertically

问题描述

I m trying to shorten the border vertically, i have tried many way but not of them work, so i want to know how to make it. i want to get result like that:

enter image description here

and my shot is :

enter image description here

Code :

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");
      },
   ),
  )

标签: flutter

解决方案


尝试这样的事情:

@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,
            )
          ],
        ),
      ),
    );
  }


推荐阅读