搜索插件、代码仓与 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 项

源码仓库

使用此插件的项目

暂无相关数据。