flutter 添加陰影
// flutter中的陰影
BoxShadow(
color: Color(0x2B000000),
offset: Offset(0.0, -4.0), //陰影xy軸偏移量
blurRadius: 15.0, //陰影模糊程度
spreadRadius: -11 //陰影擴散程度
)
單邊的話 需要注意
offset = blurRadius + spreadRadius
偏移量 等于 模糊度和擴散度之和
對于模糊度很大的時候 但是偏移量又很小 設(shè)置擴散度為 負數(shù)
修改透明度
修改透明度 可以讓陰影更淺點
下面是加了一個上邊的例子

Simulator Screen Shot - iPhone 11 Pro Max - 2020-11-26 at 11.56.49.png