搜尋套件、儲存庫與 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 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。