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

parallax_bg 封面
套件詳情v2.0.1

parallax_bg

建立美觀且互動式的視差背景

AndroidiOS
近 30 天下載
20
喜歡數
31
Pub 分數
130

安裝套件

flutter pub add parallax_bg

套件介紹

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

ParallaxBg 是一個 Flutter 套件,讓開發者能輕鬆建立視覺上吸引人且具互動性的視差背景。它支援根據使用者輸入或裝置運動產生平滑的分層移動,非常適合透過深度與動態效果提升應用介面。此套件可無縫整合至 Flutter 專案中,並在 Android 與 iOS 平台上運作。僅需最少設定,即可使用漸層、影像或自訂元件作為背景圖層,創造豐富的視覺效果。

適用情境

  • 增強啟動畫面
  • 建立沉浸式登入頁面
  • 為行動應用程式介面增添深度
  • 設計互動式敘事介面

主要特色

  • 平滑視差圖層
  • 支援多個背景圖層
  • 設備運動整合
  • 可自訂的動畫速度
  • 跨平台相容性(Android 與 iOS)

適合對象

  • 尋求視覺衝擊力的UI設計師
  • 開發人員建構吸引人的引導體驗
  • 需要動態背景效果的應用
  • 創意數位產品原型

使用建議

  • 可能影響低階裝置的效能
  • 複雜場景需要仔細優化
  • 超出基本視差行為的自訂功能有限
  • 最適合靜態或移動緩慢的內容

原始 README

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

parallax_bg

Create beautiful & interactive parallax backgrounds for your apps and games.

pub package

Example Image

You can find another working example in SlideIT Mobile Game

Usage

Add following command in your pubspec.yaml & install package

parallax_bg:2.0.1

or run

flutter pub add parallax_bg

Import in your dart page

import 'package:parallax_bg/parallax_bg.dart';

Add following to create background wrapper

    ParallaxBackground(
      backgroundImage: "assets/images/galaxy.jpg",
      parallaxType: _parallaxType,
      foregroundChilds: [
        ParallaxItem(
            child: Image.asset("assets/images/planet.png"),
            offset: _planetOffset),
        ParallaxItem(
            child: Image.asset("assets/images/meteor.png"),
            offset: _meteorOffset),
      ],
      // fallback: true,
    );

Change/Add/Remove ParallaxItem for foreground items

    ParallaxItem(
    child: Image.asset("assets/images/meteor.png"),
    offset: _meteorOffset),

ParallaxBackground

PROPERTY TYPE REQUIRED DETAILS
backgroundImage string yes Image path from asset folder
foregroundChilds List yes Widgets to create foreground layers
child Widget no Child widget to draw over all parallax widgets
reverse boolean no Move foreground items in reverse direction. Default false
fallback boolean no If true render the items normally when there are no sensors available. If false, it will show a error message in visible area. Default false

ParallaxItem

PROPERTY TYPE REQUIRED DETAILS
child Widget yes Child widget to draw over background as parallax item
offset boolean no Offset values to calculate distance to move items when moving device. Need separate value for each item. Default 5

LICENSE

MIT LICENSE

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。