乐趣区

关于flutter:Flutter基础组建使用-Container

1、增加圆角

Container(
  width: 100,
  height: 100,
  decoration: BoxDecoration(
    color: Colors.teal,
    borderRadius: BorderRadius.circular(20),
  ),
)

2、增加暗影

Container(
  width: 100,
  height: 100,
  decoration: BoxDecoration(
    color: Colors.teal,
    borderRadius: BorderRadius.circular(20),
    boxShadow: [
      BoxShadow(
        color: Colors.red,
        blurRadius: 4,
        offset: Offset(4, 8), // Shadow position
      ),
    ],
  ),
)
退出移动版