登录 注册

flutter_sticky_header

去点 Star
内容创作与媒体工具开发者工具数据分析与数据处理 dartfluttersticky-headers
998
Stars
183
Forks
13
Watchers
4
Open Issues
MIT
许可证
Dart
语言
2018-06-10
创建时间
2026-11-04
最近更新

项目能做什么

Flutter 中用于 Sliver 的吸顶标题 (Sticky Header) 实现。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# flutter_sticky_header

A Flutter implementation of sticky headers with a sliver as a child.

[![Pub](https://img.shields.io/pub/v/flutter_sticky_header.svg)](https://pub.dartlang.org/packages/flutter_sticky_header)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QTT34M25RDNL6)

![Screenshot](https://raw.githubusercontent.com/letsar/flutter_sticky_header/master/doc/images/sticky_header_all.gif)

## Features

* Accepts one sliver as content.
* Header can overlap its sliver (useful for sticky side header for example).
* Notifies when the header scrolls outside the viewport.
* Can scroll in any direction.
* Supports overlapping (AppBars for example).
* Supports not sticky headers (with `sticky: false` parameter).
* Supports a controller which notifies the scroll offset of the current sticky header.
* Notifies when the state of a header changes (with the `onStateChanged` parameter).
* Supports headers at the end of their sliver, such as date headers in a reversed chat list or sticky footers (with the `stickToEnd` parameter).

## Do you need this package?

Since Flutter 3.13, you can create simple sticky headers with the framework alone: put a pinned header (for example a `PinnedHeaderSliver`, available since Flutter 3.24) and the content in a `SliverMainAxisGroup`. The header stays pinned until the end of its group:

```dart
CustomScrollView(
  slivers: [
    SliverMainAxisGroup(
      slivers: [
        PinnedHeaderSliver(child: Header()),
        SliverList.builder(itemBuilder: ...),
      ],
    ),
  ],
)
```

This package is still useful if you need:

* a header that overlaps its content, for example sticky side headers (`overlapsContent`);
* a header built from its state, whether it is pinned and how much it is scrolled out (`SliverStickyHeader.builder`), or notified when this state changes (`onStateChanged`);
* the scroll offset of the current sticky header (`StickyHeaderController`);
* a header at the end of its sliver, sticking to the end of the viewport (`stickToEnd`), for example in a reversed list.

## Getting started

In the `pubspec.yaml` of your flutter project, add the following dependency:

```yaml
dependencies:
  ...
  flutter_sticky_header:
```

In your library add the following import:

```dart
import 'package:flutter_sticky_header/flutter_sticky_header.dart';
```

For help getting started with Flutter, view the online [documentation](https://flutter.io/).

## SliverStickyHeader

You can place one or multiple `SliverStickyHeader`s inside a `CustomScrollView`.

```dart
SliverStickyHeader(
  header: Container(
    height: 60.0,
    color: Colors.lightBlue,
    padding: EdgeInsets.symmetric(horizontal: 16.0),
    alignment: Alignment.centerLeft,
    child: Text(
      'Header #0',
      style: const TextStyle(color: Colors.white),
    ),
  ),
  sliver: SliverList(
    delegate: SliverChildBuilderDelegate(
      (context, i) => ListTile(
           
阅读完整原文

商业机会分析 AI 生成

Flutter 垂直场景高级业务组件/模板(如分类电商/分组聊天)

产品构想基于该项目深耕的滚动与吸顶状态感知能力,封装高度业务化的垂直交互组件库(例如带字母索引的吸顶通讯录、反向滚动的聊天日期吸顶与气泡联动套件、外卖双列表联动菜单)。
核心功能双列表吸顶联动组件、反向滚动聊天日期自动折叠悬浮条、吸顶动画平滑过渡、完整的开箱即用示例应用代码
目标用户独立开发者、中小外包团队、需要快速交付高还原度业务界面的 Flutter 工程师
难度/周期中等 · 3 - 6 周 · 成本:极低(纯 Dart 开发与设计成本)
收费模式在 CodeCanyon、FlutterMarket 或 Gumroad 上作为商业 UI Kit 源码单次付费销售(推测售价 $29-$79)
竞争风险Flutter 官方原生功能持续增强导致技术壁垒被进一步摊平;UI 模板市场竞争激烈且易被盗版传播
依据 AI推测

Flutter 复杂滚动交互与渲染性能优化咨询服务

产品构想利用对 Sliver 协议与复杂 RenderObject 的深度理解,提供针对中大型 Flutter 应用的复杂长列表卡顿治理、多层嵌套滚动冲突解决等技术咨询服务。
核心功能滚动性能排查与 DevTools 分析、Sliver 定制渲染管道重写、嵌套 CustomScrollView 冲突修复方案交付
目标用户拥有中大型 Flutter 线上应用、遇到列表卡顿或嵌套滚动体验差的企业客户与开发团队
难度/周期高 · 按需服务(单次 1 - 2 周) · 成本:人力时间成本为主
收费模式按技术咨询工时或项目交付收费(推测单次咨询 3000 - 15000 元)
竞争风险个人品牌获客渠道狭窄,B端技术咨询转化周期长且需求非标准化
依据 尚需验证的假设

企业级开源维护订阅与定制特性开发 (Sponsor/Bounty)

产品构想为仍在低版本 Flutter 或重度依赖该高级特性(如 stickToEnd、overlapsContent)的遗留企业项目提供有偿的向后兼容维护、Bug 修复和专项特性定制。
核心功能优先 Issue/PR 处理响应、定制功能分支维护、新版 Flutter 引擎断裂性升级兼容
目标用户重度依赖该包且难以低成本迁移至官方新 API 的企业研发团队
难度/周期低 · 持续维护 · 成本:极低维护成本
收费模式GitHub Sponsors 订阅制赞助(推测 $50 - $200/月)或单次 Bounty 悬赏
竞争风险Issue 仅存 4 个且官方已原生支持大部分功能,企业迁移官方成本可能低于付费维护,付费意愿极弱
依据 已验证事实
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

项目中文简介Stars语言
flutter/flutter 中文介绍暂未生成
Flutter makes it easy and fast to build beautiful apps for m
181,235 Dart
krahets/hello-algo 中文介绍暂未生成
《Hello 算法》:动画图解、一键运行的数据结构与算法教程。支持简中、繁中、English、日本語,提供 Python
132,217 Python
rustdesk/rustdesk 中文介绍暂未生成
An open-source remote desktop application designed for self-
129,055 Rust
localsend/localsend 中文介绍暂未生成
An open-source cross-platform alternative to AirDrop
98,473 Dart
NativeScript/NativeScript 中文介绍暂未生成
⚡ Write Native with TypeScript ✨ Best of all worlds (TypeScr
25,700 TypeScript
alibaba/flutter-go 中文介绍暂未生成
flutter 开发者帮助 APP,包含 flutter 常用 140+ 组件的demo 演示与中文文档
23,616 Dart
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。

项目优势与风险

技术成熟度创建于 2018-06-10,近 30 天仍在推送,发布过 5 个 Release
社区活跃Star 998 / Fork 183 / Issue 4(数据支持,可自行核实)
许可证MIT
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

快速开始(以仓库 README 为准)
git clone https://github.com/letsar/flutter_sticky_header.git
cd flutter_sticky_header
# 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
阅读原仓库文档
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。