Search code examples
flutterflutter-layoutflutter-widget

Fill background color of Image in flutter


Is it possible to add a background color to the Icon image? I am using the below code to render icon.

      Icon(
            Icons.check_circle_outline,
            size: 35.0,
          )

I want output like below when the image is drawn

enter image description here


Solution

  • Below Solution provide an exact output

    Container(
              color: Colors.blue,
              padding: EdgeInsets.all(5),
              child: ClipOval(
                child: Container(
                  color: Colors.green,
                  child: Icon(
                    Icons.check,
                    color: Colors.white,
                    size: 30,
                  ),
                ),
              ),
            )
    

    Output:

    enter image description here