contoured_shadow 0.1.0
contoured_shadow: ^0.1.0 copied to clipboard
Soft, shape-following shadows for Flutter widgets via a RenderObject that blurs the child silhouette. Ideal for cutout images, icons, and irregular shapes.
contoured_shadow #
Soft, shape-following shadows for Flutter — painted from the child's own silhouette rather than a rectangle.
Wrap a cutout image, icon, or any widget with transparency. Opaque pixels cast
the shadow; transparent pixels do not. Ideal for product cutouts, badges, and
irregular shapes where BoxShadow looks wrong.

Features #
- Shadow contour matches the child's alpha / shape
- Configurable blur, offset, color, and opacity
- Implemented as a lightweight
RenderProxyBox(no third-party deps) - Alias
ContouredShadowWidgetfor drop-in familiarity
Install #
dependencies:
contoured_shadow: ^0.1.0
import 'package:contoured_shadow/contoured_shadow.dart';
Usage #
ContouredShadow(
blurSigma: 8,
offset: const Offset(0, 6),
opacity: 0.3,
child: Image.asset(
'assets/product_cutout.png',
width: 180,
),
)
The child's opacity and shape define the shadow contour. Fully transparent regions cast no shadow; anti-aliased edges produce a soft matching outline.
Customization #
| Parameter | Default | Description |
|---|---|---|
child |
required | Widget whose silhouette becomes the shadow |
blurSigma |
5 |
Gaussian blur radius of the shadow |
offset |
Offset(0, 4) |
Shadow displacement relative to the child |
shadowColor |
black | Base shadow color (before opacity) |
opacity |
0.25 |
Shadow opacity (0–1) |
Example #
See the example/ app for icons and shaped surfaces with contoured
shadows.
License #
MIT
