本文介绍了Flutter 中的内阴影效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据

解决方案
decoration: BoxDecoration(盒子阴影:[常量 BoxShadow(颜色:your_shadow_color,),常量 BoxShadow(颜色:your_bg_color,传播半径:-12.0,模糊半径:12.0,),],),

According to the github issue there is no inset attribute in ShadowBox yet. Is there any workaround how to emulate inner shadow right now in flutter.

I like to achieve inner shadow effects like you can see on the following images

解决方案
decoration: BoxDecoration(
        boxShadow: [
          const BoxShadow(
            color: your_shadow_color,
          ),
          const BoxShadow(
            color: your_bg_color,
            spreadRadius: -12.0,
            blurRadius: 12.0,
          ),
        ],
      ),

这篇关于Flutter 中的内阴影效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-20 06:50