Inner shadow effect in flutter

Mac picture Mac · Jan 6, 2019 · Viewed 16.6k times · Source

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

enter image description here

enter image description here

Answer

james picture james · Mar 11, 2019
decoration: BoxDecoration(
        boxShadow: [
          const BoxShadow(
            color: your_shadow_color,
          ),
          const BoxShadow(
            color: your_bg_color,
            spreadRadius: -12.0,
            blurRadius: 12.0,
          ),
        ],
      ),