Shadows can be added to any LiquidGlass widget (including .grouped(), .withOwnLayer(), .auto(), and FakeGlass) using the shadows parameter.
Best Practices:
- Use
BlurStyle.outer to keep shadows evenly distributed around the edge. - Avoid offsets for a more natural look.
- Combine a tight, subtle shadow with a softer, wider one for depth.
LiquidGlass(
shape: LiquidRoundedSuperellipse(borderRadius: 30),
shadows: const [
// Tight, subtle edge shadow
BoxShadow(
blurStyle: BlurStyle.outer,
color: Color.from(alpha: 0.05, red: 0, green: 0, blue: 0),
blurRadius: 2,
),
// Softer, wider ambient shadow
BoxShadow(
blurStyle: BlurStyle.outer,
color: Color.from(alpha: 0.1, red: 0, green: 0, blue: 0),
blurRadius: 30,
),
],
child: const SizedBox.square(dimension: 150),
)