InnerShadowContainer πŸͺž

InnerShadowContainer is a highly customizable Flutter widget that adds beautiful and soft inner shadows to any container, ideal for neumorphic UI and modern soft design styles. Perfect for developers building elegant UIs in Flutter using subtle depth effects.

Use it to bring neumorphism, container shadows, and soft UI designs to life in your app with zero dependencies.


✨ Features

  • βœ… Inner shadow on any side: top-left, top-right, bottom-right, bottom-left
  • βœ… Fully customizable blur, offset, radius, and shadow color
  • βœ… Lightweight, dependency-free and pure Flutter implementation
  • βœ… Supports circular, rounded, or rectangular containers
  • βœ… Perfect for neumorphic and soft UI designs

πŸš€ Installation

Add this to your pubspec.yaml file:

dependencies:
  inner_shadow_container: ^1.0.4

Then run:

flutter pub get

πŸ”§ Usage

import 'package:inner_shadow_container/inner_shadow_container.dart';

InnerShadowContainer(
  height: 120,
  width: 120,
  backgroundColor: Colors.white,
  borderRadius: 20,
  blur: 6,
  offset: Offset(4, 4),
  shadowColor: Colors.black26,
  isShadowTopLeft: true,
  isShadowBottomRight: true,
  child: Center(
    child: Icon(Icons.star, size: 40, color: Colors.orange),
  ),
);

πŸ“ Parameters

Parameter Type Default Description
heightdouble?nullHeight of the container
widthdouble?nullWidth of the container
borderRadiusdouble12.0Border radius of the container
backgroundColorColorColors.whiteBackground color of the container
blurdouble4.0Shadow blur radius
offsetOffsetOffset(4, -3)Shadow offset direction
shadowColorColorColors.black26Color of the inner shadow
isShadowTopLeftboolfalseApply inner shadow on top-left side
isShadowTopRightboolfalseApply inner shadow on top-right side
isShadowBottomRightboolfalseApply inner shadow on bottom-right side
isShadowBottomLeftboolfalseApply inner shadow on bottom-left side
childWidget?nullOptional child inside the container
alignmentAlignmentAlignment.centerChild alignment

πŸ§ͺ Example App

The example below showcases all shadow directions and combinations:

Inner Shadow Container Preview
InnerShadowContainer(
  height: 140,
  width: 140,
  borderRadius: 20,
  backgroundColor: Colors.white,
  blur: 8,
  offset: Offset(5, 5),
  shadowColor: Colors.black12,
  isShadowTopLeft: true,
  isShadowTopRight: true,
  isShadowBottomLeft: true,
  isShadowBottomRight: true,
  child: Center(
    child: Padding(
      padding: EdgeInsets.all(8.0),
      child: Text(
        'All Corners Shadow',
        style: TextStyle(fontSize: 13, fontWeight: FontWeight.w600),
        textAlign: TextAlign.center,
      ),
    ),
  ),
);

πŸ’» View the full example: example/lib/main.dart


πŸ’‘ Pro Tip

You can combine multiple shadows for enhanced depth:

isShadowTopLeft: true,
isShadowTopRight: true,
isShadowBottomLeft: true,
isShadowBottomRight: true,

This gives a full immersive neumorphic feel to your containers.


πŸ“„ License

Licensed under the MIT License Β© 2025 Karan Padaliya


Made with ❀️ in Flutter β€” Powered by creativity and clean UI!