flutter 实现圆形图片

方式1

decoration: BoxDecoration(
  color: Colors.yellow,
  borderRadius: BorderRadius.all(Radius.circular(150)),
  image: DecorationImage(
      image: NetworkImage(
          "https://b-ssl.duitang.com/uploads/blog/201312/04/20131204184148_hhXUT.jpeg"),
      fit: BoxFit.cover),
)

方式2

child: ClipOval(
  child: Image.network(
    "https://b-ssl.duitang.com/uploads/blog/201312/04/20131204184148_hhXUT.jpeg",
    height: 100,
    width: 100,
    fit: BoxFit.cover,
  ),
)

你可能感兴趣的:(flutter使用记录)