Flutter rounded picture of several implementations

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/qq_27981847/article/details/90238805

Round Head

  • ClipOval

new ClipOval(
    child: Image.asset("assets/images/home/xingbiao.png",fit: BoxFit.fill),
  )
  • CircleAvatar

CircleAvatar(
    radius: 36.0,
    backgroundImage: AssetImage(
      "assets/images/home/xingbiao.png",
    ),
  )
  • BoxDecoration BoxShape.circle

Container(
    width: 72.0,
    height: 72.0,
    decoration: BoxDecoration(
      shape: BoxShape.circle,
      image: DecorationImage(
        image: AssetImage(
          "assets/images/home/xingbiao.png",
        ),
      ),
    ),
  )

Fillet Avatar

  • ClipRRect

ClipRRect(
    borderRadius: BorderRadius.circular(6.0),
    child: new Image.asset("assets/images/home/xingbiao.png"),
  )
  • BoxDecoration BoxShape.rectangle

Container(
    width: 88.0,
    height: 88.0,
    decoration: BoxDecoration(
      shape: BoxShape.rectangle,
      borderRadius: BorderRadius.circular(6.0),
      image: DecorationImage(
        image: AssetImage(
          "assets/images/home/xingbiao.png",
        ),
      ),
    ),

 

Guess you like

Origin blog.csdn.net/qq_27981847/article/details/90238805