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

ripple_wave 封面
插件详情v0.1.5

ripple_wave

简单易用的涟漪动画,可包裹在小部件中以创建美丽的涟漪效果

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
1840
喜欢数
67
Pub 分数
150

安装插件

flutter pub add ripple_wave

插件介绍

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

RippleWave 是一个轻量级的 Flutter 包,可让开发者轻松地为任何控件添加流畅且可自定义的涟漪动画。它支持基于触摸的涟漪效果,颜色、大小和持续时间均可配置,非常适合用于按钮、卡片或交互元素。该包设计简洁,设置简单,同时在所有主要平台上都能提供视觉上吸引人的效果。它可以无缝集成到现有 UI 中,并通过动态视觉反馈增强用户体验。

适合场景

  • 向按钮添加涟漪效果
  • 增强应用中的触摸反馈
  • 创建交互式 UI 元素
  • 提升仪表板的视觉吸引力
  • 动画卡片点击
  • 设计现代应用程序界面

主要特点

  • 与 widgets 的简单集成
  • 可自定义的涟漪颜色和大小
  • 流畅的动画性能
  • 跨平台支持
  • 可配置的持续时间和延迟
  • 基于触摸的涟漪触发

适合对象

  • 寻求视觉精致的UI设计师
  • 开发交互式应用的开发者
  • 需要细微反馈效果的项目
  • 具有触摸界面的移动和Web应用
  • 注重快速实现的团队

使用建议

  • 可能会影响低端设备的性能
  • 除了基本的涟漪属性外,自定义选项有限
  • 不适合复杂的动画
  • 需要手动处理手势事件
  • 建议谨慎使用,以避免视觉杂乱
  • 依赖于平台特定的渲染行为

原始 README

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

Simple and easy to use ripple animation that can be wrapped in widgets to create beautiful ripple effects.

Features

Installing

Add ripple_wave to your pubspec.yaml file.

dependencies:
  ripple_wave:

Import ripple_wave in files that it will be used.

import 'package:ripple_wave/ripple_wave.dart';

Usage

To use this package, add ripple_wave as a dependency in your pubspec.yaml file.

Then wrap your desired widget with RippleWave widget to get the ripple animation.

Usage without repeated animation:

class MyHomePage extends StatelessWidget {
  const MyHomePage({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: RippleWave(
        color: Colors.green,
        repeat: false,
        child: const Icon(
          Icons.emoji_emotions,
          size: 100,
          color: Colors.white,
        ),
      ),
    );
  }
}

Usage with tween effect on child widget of the RippleWave:

class MyHomePage extends StatelessWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: RippleWave(
        color: Colors.red,
        childTween: Tween(begin: 0.2, end: 1),
        child: const Icon(
          Icons.emoji_emotions,
          size: 100,
          color: Colors.white,
        ),
      ),
    );
  }
}

Usage with animation controller to manually start or stop the animation:

class DemoPage extends StatefulWidget {
  const DemoPage({Key? key}) : super(key: key);

  @override
  State<DemoPage> createState() => _DemoPageState();
}

late AnimationController animationController;

void start() {
  animationController.repeat();
}

void stop() {
  animationController.stop();
}

class _DemoPageState extends State<DemoPage>
    with SingleTickerProviderStateMixin {
  @override
  void initState() {
    animationController = AnimationController(
      duration: const Duration(seconds: 3),
      vsync: this,
    );
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Ripple Demo"),
      ),
      body: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          RippleWave(
            childTween: Tween(begin: 0.1, end: 1.0),
            color: Colors.deepPurpleAccent,
            repeat: false,
            animationController: animationController,
            child: const Icon(
              Icons.emoji_emotions,
              size: 100,
              color: Colors.white,
            ),
          ),
          const SizedBox(
            height: 200,
          ),
          TextButton(
            onPressed: () {
              start();
            },
            child: const Text(
              'Start animation',
            ),
          ),
          const SizedBox(
            height: 40,
          ),
          TextButton(
            onPressed: () {
              stop();
            },
            child: const Text(
              'Stop animation',
            ),
          ),
        ],
      ),
    );
  }
}

所属分类

源码仓库

使用此插件的项目

暂无相关数据。