How to recreate Figma shadow effects in Flutter widgets?

I’m working on a bottom navigation bar in Flutter and trying to match the shadow from my Figma design but I can’t get it right.

The Figma design shows a glassmorphism style navigation with a specific shadow effect. Here’s what I have so far:

class CustomBottomNav extends StatelessWidget {
  final int selectedIndex;
  final Function(int) onTabChanged;
  
  const CustomBottomNav({
    Key? key, 
    required this.selectedIndex, 
    required this.onTabChanged
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.only(bottom: 16),
      child: ClipRRect(
        child: Container(
          height: 60,
          width: 355,
          padding: EdgeInsets.all(4),
          decoration: BoxDecoration(
            color: Colors.white.withOpacity(0.08),
            border: Border.all(
              color: Colors.white.withOpacity(0.07),
              width: 1
            ),
            borderRadius: BorderRadius.circular(30),
            boxShadow: [
              BoxShadow(
                color: Color(0xFF0C0038).withOpacity(0.48),
                offset: Offset(4, 4),
                blurRadius: 20,
              ),
            ],
          ),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            children: List.generate(5, (idx) => 
              TabIcon(
                iconName: _getIconName(idx),
                active: selectedIndex == idx,
                onPressed: () => onTabChanged(idx),
              )
            ),
          ),
        ),
      ),
    );
  }
  
  String _getIconName(int idx) {
    List<String> icons = ['house', 'location', 'message', 'schedule', 'person'];
    return 'assets/svg/${icons[idx]}.svg';
  }
}

class TabIcon extends StatelessWidget {
  final String iconName;
  final bool active;
  final VoidCallback onPressed;
  
  const TabIcon({
    Key? key,
    required this.iconName,
    required this.active,
    required this.onPressed,
  }) : super(key: key);
  
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onPressed,
      child: Container(
        width: 52,
        height: 52,
        decoration: BoxDecoration(
          shape: BoxShape.circle,
          gradient: active ? LinearGradient(
            colors: [Color(0xFF2E1EEA), Color(0xFF3A8FF2)],
            stops: [0.0, 1.0],
          ) : null,
        ),
        child: Center(
          child: SvgPicture.asset(
            iconName,
            width: 24,
            height: 24,
            color: active ? Colors.white : Colors.grey.withOpacity(0.4),
          ),
        ),
      ),
    );
  }
}

The shadow doesn’t look right compared to the Figma version. What’s the correct way to implement this shadow effect in Flutter?

Your shadow offset might be the problem. Figma and Flutter measure shadows differently - that 4,4 offset from Figma usually needs to be way smaller in Flutter. Try Offset(2, 8) instead. That blurRadius of 20 is probably too much too. I’ve noticed Figma’s blur radius needs to be cut roughly in half for Flutter, so try blurRadius: 12 first. What really helped me was screenshotting both versions and comparing them side by side. Sometimes the difference is smaller than you think and you just need to tweak the numbers until they match.

check your shadow spread value - flutter’s BoxShadow has a spreadRadius property that figma users usually miss. also, your container’s clipRect might be cutting off the shadow. try removing it temporarily to see if that’s what’s happening.

Your shadow color and opacity combo might be the problem. That deep purple at 0.48 opacity renders way differently in Flutter than Figma. Try Colors.black.withOpacity(0.15) first - see if the positioning and blur look right, then tweak the color. Also check what’s behind your nav bar. Glassmorphism backgrounds can wash out shadows completely. If it’s still not popping, add a second shadow with higher opacity but barely any blur - it’ll sharpen the edges.

add multiple BoxShadow layers - dont just use one. Figma usually builds complex shadows by stacking different blur values and opacities. try a second shadow with tighter blur and a different offset. should get you closer to the design.