flutterflutter-layoutshadow

Inner shadow effect in flutter


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


Solution

  • decoration: BoxDecoration(
            boxShadow: [
              const BoxShadow(
                color: your_shadow_color,
              ),
              const BoxShadow(
                color: your_bg_color,
                spreadRadius: -12.0,
                blurRadius: 12.0,
              ),
            ],
          ),