搜索插件、代码仓与 APP 分类

soft_edge_blur 封面
插件详情v0.1.3

soft_edge_blur

一个可自定义的 Flutter 小部件,可将其子小部件的一个或多个边缘应用柔和渐进的模糊效果。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
1.4万
喜欢数
250
Pub 分数
160

安装插件

flutter pub add soft_edge_blur

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个可自定义的 Flutter 小部件,可对其子小部件的一个或多个边缘应用柔和渐进的模糊效果。非常适合创建微妙的视觉深度和现代 UI 效果,能够精确控制模糊强度和边缘方向。该包支持所有主要平台,包括移动设备、网页和桌面端,适用于跨平台应用。它能无缝集成到现有的 Flutter 布局中,并在不增加性能开销的情况下提升视觉吸引力。

适合场景

  • 在卡片中创建柔和的边缘过渡
  • 通过深度增强背景元素
  • 设计浮动UI组件
  • 改善可滚动列表中的视觉层次结构
  • 向导航栏添加细微的模糊效果

主要特点

  • 可自定义的模糊强度
  • 支持单个边缘定位
  • 跨平台兼容性
  • 轻量且高效
  • 与现有控件的轻松集成
  • 平滑渐进模糊效果

适合对象

  • 寻求现代美学的UI设计师
  • 开发沉浸式界面的开发者
  • 需要细微视觉分层的应用程序
  • 面向多个平台的项目
  • 专注于性能和简洁的团队

使用建议

  • 可能会影响低端设备的性能
  • 模糊质量取决于设备的渲染能力
  • 仅限边缘模糊
  • 不适用于全屏模糊效果
  • 需要仔细调整才能获得最佳视觉效果

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

banner

SoftEdgeBlur

pub package

A Flutter package that provides a customizable soft progressive blur effect for widgets.

Map blurred

Demos

Map - with control points

Airbnb Card with tint color

Screenshot 2024-09-17 at 22 22 01

Music play list with tint color

Screenshot 2024-09-17 at 22 22 01

Wallpapers grid with tilemode

Screenshot 2024-09-17 at 22 22 01

Usage

Import the package in your Dart code:

import 'package:soft_edge_blur/soft_edge_blur.dart';

Wrap any widget with SoftEdgeBlur to apply the blur effect:

return SoftEdgeBlur(
  edges: [
    EdgeBlur(
      type: EdgeType.topEdge,
      size: 100,
      sigma: 30,
      controlPoints: [
        ControlPoint(
          position: 0.5,
          type: ControlPointType.visible,
        ),
        ControlPoint(
          position: 1,
          type: ControlPointType.transparent,
        )
      ],
    )
  ],
  child: YourWidget(),
);

Customization

You can customize the following properties for each edge:

Edge Type

Specify which edges to apply the blur effect:

  • EdgeType.topEdge
  • EdgeType.bottomEdge
  • EdgeType.leftEdge
  • EdgeType.rightEdge

You can apply blur to multiple edges simultaneously.

Edge Size

Set the size of the blurred area. This determines how far the blur effect extends from the edge of the widget.

Blur Sigma

Adjust the intensity of the blur effect.

Tint Color

Apply a tint color on top of the blurred area.

Control Points

Define points to control the blur gradient along the edge. Each control point has two properties:

  • position: A value between 0.0 and 1.0, representing the position along the edge.
  • type: Either ControlPointType.visible or ControlPointType.transparent.
Try it live here

https://soft_edge_blur.codemagic.app/

所属分类

源码仓库

使用此插件的项目