【问题标题】:Create glass UI with flutter使用颤振创建玻璃 UI
【发布时间】:2022-07-17 16:56:41
【问题描述】:

正如标题所说,我想创建一个这样的用户界面,但我无法获得相同的结果。

现在我正在使用这个代码:

 @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
        image: DecorationImage(
          image: AssetImage('images/greydrop.jpeg'),
          fit: BoxFit.cover,
        ),
      ),
      child: BackdropFilter(
        filter: ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
        child: Scaffold(
          backgroundColor: Colors.white.withOpacity(0.6),
          appBar: AppBar(...),
          body : ....



我正在使用具有不同类型灰色的图像。 我的结果如下:

【问题讨论】:

标签: flutter effect aero-glass


【解决方案1】:

当您使用纯灰色图像时,我猜您看不到失真发生。

尝试在同一代码中使用像 THIS 这样的彩色背景。

【讨论】:

    【解决方案2】:

    您可以使用简单的“玻璃”库。 https://pub.dev/packages/glassy

    【讨论】:

      猜你喜欢
      • 2022-06-15
      • 2013-06-10
      • 2018-11-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多