3

I can't get my SVG file to be scaled properly when I load it. I just want it to be centered inside of my Container and only 24x24. But instead, it takes up much more space. Here's the code:

       Container(
          width: 88,
          height: 88,
          decoration: BoxDecoration(
            shape: BoxShape.circle,
            border: Border.all(color: Colors.white.withOpacity(0.2))
          ),
          child: SizedBox(
            width: 24,
            height: 24,
            child: SvgPicture.asset(
              iconName,
              width: 24,
              height: 24,
              fit: BoxFit.scaleDown,
              color: Colors.white,
            ),
          ),
        ),

And this is how it looks:

enter image description here

Any ideas on why the size is not being respected of either the SvgPicture.asset or the SizedBox that wraps it? Thanks

brwngrldev
  • 3,664
  • 3
  • 24
  • 45

0 Answers0