Flutter Appbar的颤振背向滤波器

Flutter Appbar的颤振背向滤波器,flutter,Flutter,如何在Appbar的颤振中使用BackdropFilter?当我将其用于Appbar其他小部件时,它们被放入Scaffold模糊,而不是Appbar 例如: BackdropFilter( filter: ImageFilter.blur( sigmaX: 5, sigmaY: 5 ), child: AppBar( automaticallyImplyLeading: false, // Used for removing back

如何在
Appbar
的颤振中使用
BackdropFilter
?当我将其用于
Appbar
其他小部件时,它们被放入
Scaffold
模糊,而不是
Appbar

例如:

BackdropFilter(
  filter: ImageFilter.blur(
      sigmaX: 5,
      sigmaY: 5
  ),

  child: AppBar(
      automaticallyImplyLeading: false,
      // Used for removing back button.
      elevation: 8.0,
      titleSpacing: 0.0,
      backgroundColor: theme.appMainColor,
      title: Stack(
        children: <Widget>[

        ],
      )),
),
BackdropFilter(
过滤器:ImageFilter.blur(
sigmaX:5,
五月五日
),
孩子:AppBar(
自动嵌入:false,
//用于移除后退按钮。
标高:8.0,
标题间距:0.0,
背景颜色:theme.appMainColor,
标题:堆栈(
儿童:[
],
)),
),

在搜索web一段时间并尝试不同的小部件组合后,我终于找到了解决方案

    appBar: PreferredSize(
      child: Container(
        child: ClipRRect(
            child: BackdropFilter(
                filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
                child: Container(
                  //   width: MediaQuery.of(context).size.width,
                  //  height: MediaQuery.of(context).padding.top,
                  color: Colors.transparent,
                ))),
      ),
      preferredSize: Size(MediaQuery.of(context).size.width, 22),
    ),

发疯

你找到这个问题的答案了吗?我面对的是同样的。@j.unruh不,我不能代替内部容器,你也可以使用AppBar小部件。和/或将其保存在单独的变量中以获取默认的AppBar高度:
AppBar.preferredSize.height