Ad

How To Add An Image Inside The Circle And Make The Border Have Color In Flutter?

- 1 answer

I am new in Flutter. I want to add an image inside the circle and make the border have color.

image

I would appreciate any help.

Ad

Answer

you can use CircleAvatar or Container with BoxDecoration

Container(
          width:105.0,
          height: 105.0,
          padding: const EdgeInsets.all(8.0),
          decoration: BoxDecoration(
            shape: BoxShape.circle,
            border: Border.all(width: 1,color: Colors.blue),
            image: DecorationImage(
              fit: BoxFit.fill,
              image: NetworkImage("https://picsum.photos/500/300?random=1")
            )
          )
        )

Ad
source: stackoverflow.com
Ad