enter image description here我需要创建此自定义容器我尝试了更多,使它的边界半径,但我不能这样做,我希望堆栈溢出做
kqlmhetl1#
可以使用DecoratedBox设置每个角的边界半径:
Center( child: DecoratedBox( decoration: BoxDecoration( color: Colors.deepOrangeAccent.shade200, borderRadius: const BorderRadius.only( bottomLeft: Radius.circular(100), bottomRight: Radius.circular(4), topLeft: Radius.circular(8), topRight: Radius.circular(8), ), ), child: const SizedBox( height: 100, width: 100, ), ), ),
mbyulnm02#
请尝试以下代码:
Container( height: 100.0, width: 100.0, decoration: BoxDecoration( color: Colors.orange[100], borderRadius: const BorderRadius.only( topLeft: Radius.circular(15.0), topRight: Radius.circular(15.0), bottomLeft: Radius.circular(100.0), bottomRight: Radius.circular(5.0), ), ), ),
2条答案
按热度按时间kqlmhetl1#
可以使用DecoratedBox设置每个角的边界半径:
mbyulnm02#
请尝试以下代码: