简体   繁体   中英

How to add an image inside the circle and make the border have color in Flutter?

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

图片

I would appreciate any help.

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")
            )
          )
        )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM