美文网首页
2020-05-13 BoxDecoration

2020-05-13 BoxDecoration

作者: rub1cky | 来源:发表于2020-05-13 11:45 被阅读0次
    BoxDecoration({
        this.color, // 颜色
        this.image, // 图片
        this.border, // 边框
        this.borderRadius, // 圆角 和 shape不能同时用
        this.boxShadow, // 
        this.gradient,
        this.backgroundBlendMode,
        this.shape = BoxShape.rectangle, // 形状
      })
    

    Demo

    截屏2020-05-13 上午11.45.33.png
    return Container(
          width: 200,
          height: 200,
          decoration: BoxDecoration(
            border: Border.all(
              width: 30,
              color: Colors.red
            ),
    //        borderRadius: BorderRadius.circular(10.0),
            boxShadow: [
              BoxShadow(
                color: Colors.amber,
                blurRadius: 5.0,
              ),
              BoxShadow(
                color: Colors.green,
                blurRadius: 10.0,
                offset: Offset(3.5, 12)
              )
            ],
            shape: BoxShape.circle,
            image: DecorationImage(
                image: NetworkImage("https://img2.woyaogexing.com/2020/05/13/f74a273d69884ed9a5d8f73b5376fcdf!400x400.jpeg"),
                fit: BoxFit.fitHeight
            )
          ),
        );
    

    相关文章

      网友评论

          本文标题:2020-05-13 BoxDecoration

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