ParallaxRain 是一个 Flutter 包,使开发者能够在其应用程序中创建沉浸式的 3D 雨效果。通过可自定义的功能,如多种雨滴颜色、可变的下落速度和轨迹效果,它增强了背景和交互场景的视觉吸引力。适用于追求氛围感或电影质感的应用程序,支持所有主要平台,包括移动设备、网页和桌面端。该包可无缝集成到 Flutter 的渲染管道中,并利用着色器实现流畅性能。
适合场景
创建动态应用背景
增强游戏环境
为启动画面添加电影效果
通过视觉反馈提升用户参与度
基于情绪设计界面
主要特点
可自定义的雨滴颜色
可调节的雨滴速度
雨滴轨迹效果
跨平台支持
基于着色器的渲染
与 Flutter 小部件的轻松集成
适合对象
寻求视觉魅力的UI设计师
游戏开发者构建沉浸式场景
专注于氛围的应用程序创作者
面向多平台部署的开发者
具有艺术主题的创意项目
使用建议
可能会影响低端设备的性能
需要了解基本的着色器概念
最适合用于背景图层,不适合主要内容
超出雨天特定参数的自定义功能有限
不适合高频交互元素
原始 README
以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。
Parallax Rain
Create a cool 3D rain effect, with plenty of customization!
Installation
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies:parallax_rain:
2. Install it
You can install packages from the command line:
$ pub get
..
Alternatively, your editor might support pub. Check the docs for your editor to learn more.
3. Import it
Now in your Flutter code, you can use:
import'package:parallax_rain/parallax_rain.dart';
Usage
If you want to give YourWidget a 3D rain background, simple wrap it with the ParallaxRain widget, with YourWidget as the child parameter. You can also have the rain effect in the foreground, use multiple drop colors, adjust the speed, add trails to your drops and lots more!
A full example can be found in the example directory
About me
Visit my LinkedIn at https://www.linkedin.com/in/zaca
I'm also the author of the Flutter glass package that allows you to convert any flutter widget into a glass/frosted glass version of itself, check it out at https://pub.dev/packages/glass