inner_shadow_flutter 0.0.1
inner_shadow_flutter: ^0.0.1 copied to clipboard
A Flutter widget that renders an inner shadow effect on its child widget. Lightweight and customizable — supports blur radius, color, and offset.
inner_shadow_flutter #
A Flutter widget that renders a customizable inner shadow effect on its child widget. Lightweight, dependency-free, and works on all Flutter platforms.
Preview #

Features #
- Configurable blur radius
- Configurable shadow color and opacity
- Configurable X/Y offset
- Works with any child widget
- No external dependencies
Installation #
Add this to your pubspec.yaml:
dependencies:
inner_shadow_flutter: ^0.0.1
Then run:
flutter pub get
Usage #
import 'package:inner_shadow_flutter/inner_shadow_flutter.dart';
InnerShadow(
blur: 10,
color: Colors.black38,
offset: const Offset(10, 10),
child: Container(
width: 200,
height: 200,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
),
)
Parameters #
| Parameter | Type | Default | Description |
|---|---|---|---|
blur |
double |
10 |
The blur radius of the inner shadow |
color |
Color |
Colors.black38 |
The color and opacity of the shadow |
offset |
Offset |
Offset(10, 10) |
The X and Y offset of the shadow |
child |
Widget? |
null |
The widget to apply the inner shadow to |
Example #
Run the included example app:
cd example
flutter run
The example app features live sliders to control blur, offset X/Y, and shadow color with a real-time code preview.
Author #
Salah Saad
Email: kassabksab@gmail.com
Repository: https://github.com/salahsaads/InnerShadow
Credits #
Based on the Stack Overflow answer by Alexandr Priezzhev, licensed under CC BY-SA 4.0.
License #
MIT License. See LICENSE for details.