美文网首页Flutter工作生活
flutter - 圆角,圆形图片

flutter - 圆角,圆形图片

作者: ForstDragon | 来源:发表于2019-07-03 10:22 被阅读0次

圆形头像

ClipOval

new ClipOval(
    child: new Image.asset('images/header.png'),
  )

CircleAvatar

new CircleAvatar(
    radius: 36.0,
    backgroundImage: AssetImage(
      'images/header.png',
    ),
  )

BoxDecoration BoxShape.circle

 new Container(
    width: 72.0,
    height: 72.0,
    decoration: BoxDecoration(
      shape: BoxShape.circle,
      image: DecorationImage(
        image: AssetImage(
          'images/header.png',
        ),
      ),
    ),
  )

圆角头像

ClipRect

new ClipRect(
    borderRadius: BorderRadius.circular(6.0),
    child: new Image.asset('images/header.png'),
  )

BoxDecoration BoxShape.rectangle

new Container(
    width: 88.0,
    height: 88.0,
    decoration: BoxDecoration(
      shape: BoxShape.rectangle,
      borderRadius: BorderRadius.circular(6.0),
      image: DecorationImage(
        image: AssetImage(
          'images/header.png',
        ),
      ),
    ),

Copy:Flutter 圆形/圆角头像

相关文章

网友评论

    本文标题:flutter - 圆角,圆形图片

    本文链接:https://www.haomeiwen.com/subject/ribfhctx.html