【问题标题】:ImageFilter.blur (BackdropFilter) Not working | FlutterImageFilter.blur (BackdropFilter) 不工作 |扑
【发布时间】:2022-11-20 02:37:26
【问题描述】:

当我在 Containers child 中使用 Backdrop Filter 时,手机屏幕变黑。当我删除该编码时。它显示背景图像。怎么了?

我想模糊应用程序的背景图片。没有错误显示。但最终渲染是黑屏。没有任何图像

Stack(
        children: [
        //background image here with blur
        Container(
          decoration: const BoxDecoration(
            image: DecorationImage(
              image: AssetImage('assets/images/u2.jpg'),
              fit: BoxFit.cover,
            ),
          ),
          child: BackdropFilter(
            filter: ImageFilter.blur(
              sigmaX: 10,
              sigmaY: 10,
            ),
          ),
        ),
],),

【问题讨论】:

    标签: flutter dart flutter-layout


    【解决方案1】:

    尝试使用BackdropFilterchild

     BackdropFilter(
      filter: ImageFilter.blur(
        sigmaX: 10,
        sigmaY: 10,
      ),
      child: Image.asset(...),
    ),
    

    【讨论】:

    • 它也不起作用。这次尝试,显示图像没有模糊
    • 需要提供尺码
    猜你喜欢
    • 1970-01-01
    • 2016-08-30
    • 1970-01-01
    • 2020-04-01
    • 2021-08-17
    • 2020-05-04
    • 1970-01-01
    • 2021-11-18
    • 2018-06-23
    相关资源
    最近更新 更多