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

插件详情v0.0.5

visual_effect

Flutter 的 VisualEffect API,可轻松为您的小部件添加绘画效果。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
329
喜欢数
72
Pub 分数
140

安装插件

flutter pub add visual_effect

插件介绍

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

VisualEffect 是一个 Flutter 包,可简化将绘画效果应用于小部件的过程,使开发者能够以最少的代码增强视觉吸引力。它提供了一个直观的 API,可直接向用户界面元素添加模糊、阴影和颜色滤镜等效果。专为跨平台的无缝集成而设计,支持 Android、iOS、Web、macOS、Windows 和 Linux。适用于创建具有丰富视觉反馈的动态界面,特别适合需要细微或戏剧性图形增强的现代应用设计。

适合场景

  • 为背景添加模糊效果
  • 创建发光或阴影文字
  • 通过动态涂鸦效果增强按钮
  • 设计沉浸式启动画面
  • 实现动画叠加层
  • 对图像应用颜色滤镜

主要特点

  • 用于绘制效果的简单 API
  • 跨平台兼容性
  • 支持模糊、阴影和颜色滤镜
  • 与现有控件的轻松集成
  • 高性能渲染
  • 实时效果调整

适合对象

  • 寻求视觉精致的UI设计师
  • 开发现代应用程序界面的开发者
  • 需要动画或交互式视觉效果的应用
  • 面向多个平台的项目
  • 原型化视觉丰富的组件

使用建议

  • 可能会影响低端设备的性能
  • 需要了解绘图操作
  • 仅限视觉效果,不包括布局更改
  • 不适合复杂的动画
  • 效果质量可能因平台而异

原始 README

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

visual_effect

VisualEffect API for Flutter to easily add paint effects on your widgets.

Warning This package is experimental for the moment. The API can change at any time.

Scroll Effect

The main purpose of this API is to provide an easy and efficiently way to apply scroll animations.

Warning The addRepaintBoundaries MUST be set to false in the parent Sliver/ScrollView because we explicitely want in that case to repaint for every single scroll so we can add the effect.

For example this Card Stack effect can be obtained with the code below:

Card Stack

class _ScrolledItem extends StatelessWidget {
  const _ScrolledItem();

  @override
  Widget build(BuildContext context) {
    return ScrollEffect(
      onGenerateVisualEffect: (effect, phase) {
        return effect
            .grayscale(phase.leadingLerp(to: 0.5))
            .scale(
              x: phase.isLeading ? phase.leadingLerp(from: 1, to: 0.9) : 1,
              anchor: Alignment.topCenter,
            )
            .translate(y: effect.childSize.height * phase.leading);
      },
      child: const _CardItem(),
    );
  }
}

所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目

暂无相关数据。