[英]Flutter: How can I customize the Border of a Container (or other Widgets)?
I have a special requirement on my Container
border.我对Container
边框有特殊要求。 It should only have a border on the left , right and bottom but not on the top.它应该只在左侧、右侧和底部有边框,但在顶部没有边框。
Container(
decoration: BoxDecoration(
color: Color.fromRGBO(146, 94, 58, 1.0),
border: Border.all(
color: Color.fromRGBO(85, 63, 48, 1.0),
width: 2,
),
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(2),
bottomRight: Radius.circular(2),
),
),
)
I can only find .all
and .symmetric
but nothing like .only
which I have seen for the BorderRadius
Widget.我只能找到.all
和.symmetric
但没有像我在.only
Widget 中看到的BorderRadius
。 Why is it missing for Border
and how can I make this still work?为什么Border
缺少它,我怎样才能使它仍然有效?
and you can read this article 你可以阅读这篇文章
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(width: 1.5, color: Colors.grey[300]),
),
),
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.