搜索分类、插件与代码仓

background_app_bar 封面
插件详情v2.1.0+1

background_app_bar

一个背景应用栏插件,如果您希望在滚动时保留滑动应用栏的背景,请使用此插件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
30
喜欢数
47
Pub 分数
140

安装插件

flutter pub add background_app_bar

插件介绍

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

background_app_bar 包是一个 Flutter 插件,旨在滚动时保持 SliverAppBar 的背景外观。它确保视觉背景(如图像或渐变)在用户滚动时保持可见且一致,从而增强应用程序界面的视觉连续性。适用于具有丰富、沉浸式设计的应用程序,该插件可在 Android、iOS、Web、macOS、Windows 和 Linux 等多个平台上使用。该插件可无缝集成到现有的 SliverAppBar 实现中,无需进行重大代码更改。

适合场景

  • 在可滚动界面中保持视觉连续性
  • 使用持久背景创建沉浸式应用体验
  • 增强滚动时的UI设计一致性
  • 构建视觉丰富的仪表板或画廊
  • 使用稳定背景实现视差效果

主要特点

  • 滚动时保留背景
  • 支持图像和渐变
  • 跨平台兼容性
  • 与 SliverAppBar 的轻松集成
  • 最小配置要求

适合对象

  • 注重设计的 Flutter 应用程序
  • 具有复杂滚动布局的应用程序
  • 注重视觉精致的开发者
  • 大量使用 SliverAppBar 的项目
  • 构建多平台应用的团队

使用建议

  • 可能会影响大型背景资源的性能
  • 需要仔细处理图像分辨率
  • 不适合简单的、极简的用户界面
  • 除了保留背景外,自定义功能有限
  • 最佳搭配优化的资源以实现流畅滚动

原始 README

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

Widget Background App Bar

A background app bar plugin, use this plugin if you want to preserve background of sliver app bar when scrolling,

inspired by GradientAppBar GitHub

Screenshots

Don't forget to tap + button 5 times

Screenshot-1565398534.png Screenshot-1569417041.png Screenshot-1569417048.png Screenshot-1569417051.png

Getting Started

  1. Depend on it by adding this to your pubspec.yaml file: background_app_bar: ^1.0.0

  2. Import it: import 'package:background_app_bar/background_app_bar.dart'

  3. Replace your current FlexibleSpaceBar (In the AppBar or SliverAppBar) to BackgroundFlexibleSpaceBar.

SliverAppBar(
    expandedHeight: _kAppBarSize,
    floating: false,
    pinned: true,
    snap: false,
    elevation: 0.0,
    backgroundColor: Colors.transparent,
    flexibleSpace: BackgroundFlexibleSpaceBar(
        title: widget.title != null ? Text(widget.title!) : null,
        centerTitle: false,
        titlePadding: const EdgeInsets.only(left: 20.0, bottom: 20.0),
        background: ClipRect(
            child: Container(
                child: BackdropFilter(
                    filter: ImageFilter.blur(sigmaX: 5.0, sigmaY: 5.0),
                    child: Container(
                        decoration: BoxDecoration(
                            color: Colors.black.withOpacity(0.5),
                        ),
                    ),
                ),
                decoration: const BoxDecoration(
                    image: DecorationImage(
                        image: AssetImage("images/bg.jpg"),
                        fit: BoxFit.fill,
                    ),
                ),
            ),
        ),
    ),
)

所属分类

源码仓库

使用此插件的项目

暂无相关数据。