【问题标题】:How to blur part of a image? [closed]如何模糊图像的一部分? [关闭]
【发布时间】:2022-01-05 04:29:58
【问题描述】:

下面我有一个插图,让我们忽略其他细节,专注于图像的底部。它有一条微弱的白色条纹,我不知道如何实现。它可以是图像模糊,也可以是颜色渐变。很高兴你们能帮我制作白色模糊

【问题讨论】:

  • 你可以参考here

标签: flutter


【解决方案1】:

希望您得到解决方案!

Scaffold(
      body: Stack(
        alignment: Alignment.center,
        children: <Widget>[
          ClipRRect(
            borderRadius: BorderRadius.circular(15),
            child: Image(
              fit: BoxFit.fill,
              image: AssetImage("assets/robot.jpg"),
              height: MediaQuery.of(context).size.height,
              width: MediaQuery.of(context).size.width,
            ),
          ),
          Container(
            height: MediaQuery.of(context).size.height,
            width: MediaQuery.of(context).size.width,
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(15),
              gradient: LinearGradient(
                begin: Alignment.center,
                end: Alignment.bottomCenter,
                colors: [
                  const Color(0x00000000),
                  const Color(0xFFFFFFFF),
                ],
              ),
            ),
          ),
        ],
      ),
      floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
      floatingActionButton: FloatingActionButton(
        onPressed: () {},
        backgroundColor: Colors.red,
        child: Icon(Icons.arrow_forward_ios),
      ),
    ); 

【讨论】:

  • 非常感谢,渐变色的技巧太聪明了。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-11-26
  • 2014-12-03
  • 2018-04-14
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多