搜尋套件、儲存庫與 APP 分類

flutter_moving_background 封面
套件詳情v0.4.0

flutter_moving_background

一個用於建立美麗且帶有動畫效果背景的 Flutter 套件,例如漸變、圓形形狀和粒子效果

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1460
喜歡數
38
Pub 分數
155

安裝套件

flutter pub add flutter_moving_background

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個用於建立視覺上吸引人的動畫背景的 Flutter 套件,使用漸變、圓形形狀和粒子效果。非常適合透過跨多個平台高效運行的動態、流暢動畫來提升應用美學。該套件支援自訂顏色、移動速度和粒子密度,適用於啟動畫面、登入頁面或沉浸式使用者介面。它與 Flutter 的小工具系統無縫整合,並利用硬體加速以實現高效能。非常適合希望在不需複雜程式碼的情況下增添現代、引人入勝視覺效果的開發者。

適用情境

  • 啟動畫面
  • 登入介面
  • 沉浸式儀表板
  • 動畫引導
  • 數位藝術展示的背景

主要特色

  • 動畫漸變
  • 粒子效果
  • 圓形形狀動畫
  • 可自訂的速度與密度
  • 跨平台支援
  • 硬體加速渲染

適合對象

  • 尋求視覺魅力的UI設計師
  • 開發人員建構吸引人的引導流程
  • 需要動態背景視覺效果的應用程式
  • 創意數位體驗
  • 面向前端的 Flutter 項目

使用建議

  • 可能影響低階裝置的效能
  • 需要仔細優化以降低電池耗損
  • 對單個粒子行為的控制有限
  • 最適合靜態或緩慢移動的動畫
  • 不適合高頻率互動背景

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Flutter Moving Background

A high-performance Flutter package for creating beautiful, customizable moving backgrounds.

See an Example here : https://movingbg.netlify.app/

Sunset Preset

Aurora Preset

Cyberpunk Preset

Constellation

Flowing Waves

Bouncing Bubbles

Parallax Rain

Features

  • [X] High Performance: Optimized with a single Ticker, CustomPainter, and zero-allocation paint loops for smooth 60fps+ animations.
  • [X] Shader Caching: Highly optimized parallax trail rendering in rain animations to prevent frame drops.
  • [X] Beautiful Presets: Built-in design presets (sunset, aurora, cyberpunk, themed).
  • [X] Multiple Background Styles: Includes MovingBackground, BubbleBackground, RainBackground, ConstellationBackground, and WaveBackground.
  • [X] Pause/Resume: Easily pause animations when not needed to save battery.
  • [X] Customizable: Control colors, radius, blur, speed, and more.
  • [X] Lightweight: Minimal impact on your app's widget tree (zero dependencies outside Flutter).

Supported Platforms

  • Flutter Android
  • Flutter iOS
  • Flutter Web
  • Flutter Desktop

Getting started

In your flutter project add the dependency:

dependencies:
  flutter_moving_background: ^0.3.0

Import the package:

import 'package:flutter_moving_background/flutter_moving_background.dart';

How to use

1. Moving Circles Presets (One-Liners)

Create beautiful glowing backgrounds instantly using const preset constructors:

// Warm sunset oranges & deep purples
MovingBackground.sunset(child: YourWidget())

// Neon green & dark space blue auroras
MovingBackground.aurora(child: YourWidget())

// Electric magenta & neon cyan cyberpunk theme
MovingBackground.cyberpunk(child: YourWidget())

// Theme-aware color schemes (inherits primary/secondary/tertiary colors from active ThemeData)
MovingBackground.themed(context, child: YourWidget())
2. Custom Moving Circles
MovingBackground(
  backgroundColor: Colors.white,
  animationType: AnimationType.pulse,
  duration: Duration(seconds: 10),
  circles: const [
    MovingCircle(color: Colors.purple, radius: 300),
    MovingCircle(color: Colors.deepPurple, radius: 500),
    MovingCircle(color: Colors.orange, radius: 400),
  ],
  child: Center(child: Text("Hello World")),
)
3. Constellation Background (Interactive Particle Web)

A tech-oriented particle system where floating nodes slowly move. Nearby nodes are connected by dynamic, distance-based web lines. Includes mouse hover / touch attraction.

ConstellationBackground(
  particleCount: 50,
  maxDistance: 120.0,
  speed: 1.0,
  colors: const [Colors.cyanAccent, Colors.pinkAccent],
  lineColor: Colors.white12,
  child: YourWidget(),
)
4. Flowing Waves Background

Layered sine waves that flow horizontally with parallax speeds and customizable wave heights/amplitudes for soothing fluid landscape aesthetics.

WaveBackground(
  waveCount: 3,
  speed: 1.0,
  amplitude: 25.0,
  frequency: 0.005,
  colors: const [Colors.blue, Colors.teal, Colors.cyan],
  child: YourWidget(),
)
5. Bubble Background
BubbleBackground(
  numBubbles: 15,
  colors: [Colors.blue, Colors.purple],
  speed: 1.5,
  child: YourWidget(),
)
6. Rain Background
RainBackground(
  numberOfDrops: 100,
  fallSpeed: 2.0,
  hasTrail: true,
  colors: const [Colors.blue],
  child: YourWidget(),
)

Animation Types

Type Description
moveAndFade Circles move to random positions while fading in and out.
pulse Circles move while their size and opacity pulse rhythmically.
scale Circles scale from zero to full size and back as they move.
move Circles move at constant opacity and size.

Contributing

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 fill an issue.
If you fixed a bug or implemented a feature, please send a pull request.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。