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

插件详情v0.1.4

flutter_sinusoidals

一个 Flutter 包,可帮助您按需可视化正弦波。所有基本波形均已支持,还包括自定义波形和一些预定义波形。

近 30 天下载
45
喜欢数
110
Pub 分数
40

安装插件

flutter pub add flutter_sinusoidals

插件介绍

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

flutter_sinusoidals 是一个专为创建和可视化正弦波而设计的 Flutter 包,支持自定义参数。它提供基本波形类型,允许用户定义自定义波形,并包含多种预设波形模式。适用于动画、数据可视化或交互式 UI 元素,可实现平滑的实时正弦图形渲染。该包轻量级且与 Flutter 项目无缝集成,只需少量代码即可生成动态波形效果。特别适合教育类应用、音乐可视化或任何需要节奏性振荡图形的应用。

适合场景

  • 创建动画波浪背景
  • 可视化声音或信号数据
  • 构建交互式音乐可视化
  • 三角学的教育工具
  • 设计动态UI过渡

主要特点

  • 支持基本和自定义正弦波
  • 包含预定义的波形模式
  • 实时波形渲染
  • 与 Flutter 的简单集成
  • 可配置的振幅、频率和相位

适合对象

  • Flutter 开发人员构建动画
  • 教育类应用开发者
  • 音频可视化项目
  • 寻求动态效果的UI设计师
  • 交互式数据展示应用

使用建议

  • 仅限2D波形可视化
  • 无内置音频处理
  • 需要手动处理动画时序
  • 未针对高频更新进行优化
  • 依赖于 Flutter 的渲染性能

原始 README

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

flutter_sinusoidals

Pub

A flutter package that helps you to visualize sine waves as you desire. All basic waves are already supported, plus customized waves & some pre-defined waves.

Overview

Features

  • Creating a sine wave.
  • Creating a stack of sine waves.
  • Combine multiple sine waves together.
  • This package use clipping to achieve wave effect so theoretically you can apply it to any widget. For example, an AppBar with a wave on the bottom.

Getting started

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  flutter_sinusoidals:

In your code add the following import:

import 'package:flutter_sinusoidals/flutter_sinusoidals.dart';

Built-in waves

This package comes with 4 kinds of sine waves:

Sinusoidal

A widget which helps visualize a sinusoidal.

Overview

Example of a sinusoidal:

Sinusoidal(
  model: const SinusoidalModel(
    formular: WaveFormular.standing,
    amplitude: 25,
    waves: 2.5,
    frequency: 1.5,
  ),
  child: Container(
    height: 100,
    color: Colors.blue,
  ),
),
Sinusoidals

A widget which helps visualize a stack of sinusoidals.

Overview

Example of a sinusoidals:

Sinusoidals(
  itemCount: 3,
  builder: (context, index) {
    return SinusoidalItem(
      model: SinusoidalModel(
        formular: WaveFormular.travelling,
        amplitude: _amplitude,
        waves: _waves,
        translate: 5.0 * (index + 1),
        center: 5.0 * (index + 1),
      ),
      child: Container(
        height: _height,
        color: _colors[index],
      ),
    );
  },
);
CombinedWave

A widget which helps visualize a combined wave.

A combined wave is a wave that is formed by adding multiple sinusoidals together.

Overview

Example of a combined wave:

CombinedWave(
  reverse: true,
  models: const [
    SinusoidalModel(
      amplitude: 25,
      waves: 20,
      translate: 2.5,
      frequency: 0.5,
    ),
    SinusoidalModel(
      amplitude: 25,
      waves: 15,
      translate: 7.5,
      frequency: 1.5,
    ),
  ],
  child: Container(
    height: 200,
    color: Colors.blue,
  ),
),
MagmaWave

A pre-defined wave that mimicking magma motion.

This is included in the package just to demonstrate that you can create an awesome wave by combining multiple waves together.

Overview

References

To know how sinusoidal works: sinusoidal

Try demos to observe how sinusoidal visually works, and create your version by forming formulas.

Changelog

See the Changelog to know what was changed.

Contributions

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fire an issue.

If you fixed a bug or implemented a feature, please send a pull request.

Special Thanks

A big thank you to KhanAcademy & Wiki for foundational knowledge about sine wave.

A big thank you to all the contributors to the project. Every PR / reported issue is greatly appreciated!

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目

暂无相关数据。