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

插件详情v0.1.1

ripple_effect

在您的 Flutter 应用中,轻松从任意控件开始,向整个屏幕产生涟漪效果。

近 30 天下载
10
喜欢数
34
Pub 分数
40

安装插件

flutter pub add ripple_effect

插件介绍

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

ripple_effect 包为 Flutter 应用程序中的任何小部件提供了一种简单的方法,可以在整个屏幕上触发涟漪动画。它通过扩展的同心圆视觉响应点击或手势来增强用户交互,模拟水面上自然的涟漪效果。适用于按钮、图标或触摸目标,无需复杂的自定义动画即可添加细微反馈。该包轻量且可无缝集成到现有 UI 中。支持 Android 和 iOS 平台,确保在不同设备上行为一致。

适合场景

  • 向按钮添加视觉反馈
  • 增强触摸交互
  • 创建引人入胜的应用程序引导屏幕
  • 提高手势响应速度
  • 设计交互式UI元素
  • 游戏中动画点击点

主要特点

  • 与任何 widget 的简单集成
  • 全屏涟漪传播
  • 可自定义的涟漪颜色和大小
  • 带有性能优化的平滑动画
  • 跨平台兼容性
  • 最小化样板代码

适合对象

  • 寻求快速视觉反馈的开发人员
  • UI设计师提升用户体验
  • 高触控交互的应用
  • 游戏或交互原型
  • 项目优先考虑流畅的动画

使用建议

  • 可能会影响低端设备的性能
  • 涟漪效果可能不适合注重可访问性的应用程序
  • 除了颜色和大小之外,自定义选项有限
  • 不适合复杂的分层动画
  • 需要仔细放置以避免视觉杂乱
  • 建议谨慎使用,以保持用户体验的清晰性

原始 README

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

Pub Package GitHub Actions

ripple_effect

A easy way to achieve a ripple effect on you flutter app.

Usage

First you need to wrap your page/Scaffold with the RipplePage widget, the ripple efect will growth until this widget. Then wrap with the RippleEffect where the animation should begin. When the animation should begin, call the RippleEffect.start method passing you callback method(often navigate to other page).

The RipplePage and RippleEffect widgets need their GlobalKeys respectively to work.

Example

class Stateless extends StatelessWidget {
  final pageKey = RipplePage.createGlobalKey();
  final effectKey = RippleEffect.createGlobalKey();
  
  @override
  Widget build(BuildContext context) {
    return RipplePage(
      child: Scaffold(
        body: Center(),
        floatingActionButton: RippleEffect(
          pageKey: pageKey,
          effectKey: effectKey,
          color: Colors.blue,
          child: FloatingActionButton(
            backgroundColor: Colors.blue,
            onPressed: () =>
                 RippleEffect.start(effectKey, () => toNextPage(context)),
            child: Icon(Icons.arrow_back),
          ),
        )
      ),
    );
  }
}

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目

暂无相关数据。