{"id":13465580,"url":"https://github.com/letsar/flutter_sticky_header","last_synced_at":"2025-05-14T12:08:47.611Z","repository":{"id":32584038,"uuid":"136786504","full_name":"letsar/flutter_sticky_header","owner":"letsar","description":"Flutter implementation of sticky headers for sliver","archived":false,"fork":false,"pushed_at":"2024-10-14T13:40:12.000Z","size":4482,"stargazers_count":945,"open_issues_count":36,"forks_count":184,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-05T00:02:00.985Z","etag":null,"topics":["dart","flutter","sticky-headers"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/letsar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"letsar","patreon":"romainrastel","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.buymeacoffee.com/romainrastel","paypal.me/RomainRastel"]}},"created_at":"2018-06-10T06:53:28.000Z","updated_at":"2025-04-01T11:22:45.000Z","dependencies_parsed_at":"2024-06-21T16:38:53.952Z","dependency_job_id":"382dc9bd-50d7-45c5-988c-d21767013148","html_url":"https://github.com/letsar/flutter_sticky_header","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsar%2Fflutter_sticky_header","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsar%2Fflutter_sticky_header/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsar%2Fflutter_sticky_header/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsar%2Fflutter_sticky_header/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/letsar","download_url":"https://codeload.github.com/letsar/flutter_sticky_header/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248509963,"owners_count":21116125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","flutter","sticky-headers"],"created_at":"2024-07-31T15:00:32.140Z","updated_at":"2025-04-12T02:55:09.656Z","avatar_url":"https://github.com/letsar.png","language":"Dart","readme":"# flutter_sticky_header\n\nA Flutter implementation of sticky headers with a sliver as a child.\n\n[![Pub](https://img.shields.io/pub/v/flutter_sticky_header.svg)](https://pub.dartlang.org/packages/flutter_sticky_header)\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=QTT34M25RDNL6)\n\n![Screenshot](https://raw.githubusercontent.com/letsar/flutter_sticky_header/master/doc/images/sticky_header_all.gif)\n\n## Features\n\n* Accepts one sliver as content.\n* Header can overlap its sliver (useful for sticky side header for example).\n* Notifies when the header scrolls outside the viewport.\n* Can scroll in any direction.\n* Supports overlapping (AppBars for example).\n* Supports not sticky headers (with `sticky: false` parameter).\n* Supports a controller which notifies the scroll offset of the current sticky header.\n\n## Getting started\n\nIn the `pubspec.yaml` of your flutter project, add the following dependency:\n\n```yaml\ndependencies:\n  ...\n  flutter_sticky_header:\n```\n\nIn your library add the following import:\n\n```dart\nimport 'package:flutter_sticky_header/flutter_sticky_header.dart';\n```\n\nFor help getting started with Flutter, view the online [documentation](https://flutter.io/).\n\n## SliverStickyHeader\n\nYou can place one or multiple `SliverStickyHeader`s inside a `CustomScrollView`.\n\n```dart\nSliverStickyHeader(\n  header: Container(\n    height: 60.0,\n    color: Colors.lightBlue,\n    padding: EdgeInsets.symmetric(horizontal: 16.0),\n    alignment: Alignment.centerLeft,\n    child: Text(\n      'Header #0',\n      style: const TextStyle(color: Colors.white),\n    ),\n  ),\n  sliver: SliverList(\n    delegate: SliverChildBuilderDelegate(\n      (context, i) =\u003e ListTile(\n            leading: CircleAvatar(\n              child: Text('0'),\n            ),\n            title: Text('List tile #$i'),\n          ),\n      childCount: 4,\n    ),\n  ),\n);\n```\n\n## SliverStickyHeader.builder\n\nIf you want to change the header layout during its scroll, you can use the `SliverStickyHeader.builder` constructor.\n\nThe example belows changes the opacity of the header as it scrolls off the viewport.\n\n```dart\nSliverStickyHeader.builder(\n  builder: (context, state) =\u003e Container(\n        height: 60.0,\n        color: (state.isPinned ? Colors.pink : Colors.lightBlue)\n            .withOpacity(1.0 - state.scrollPercentage),\n        padding: EdgeInsets.symmetric(horizontal: 16.0),\n        alignment: Alignment.centerLeft,\n        child: Text(\n          'Header #1',\n          style: const TextStyle(color: Colors.white),\n        ),\n      ),\n  sliver: SliverList(\n    delegate: SliverChildBuilderDelegate(\n      (context, i) =\u003e ListTile(\n            leading: CircleAvatar(\n              child: Text('0'),\n            ),\n            title: Text('List tile #$i'),\n          ),\n      childCount: 4,\n    ),\n  ),\n);\n```\n\nYou can find more examples in the [Example](https://github.com/letsar/flutter_sticky_header/tree/master/example) project.\n\n## Sponsoring\n\nI'm working on my packages on my free-time, but I don't have as much time as I would. If this package or any other package I created is helping you, please consider to sponsor me. By doing so, I will prioritize your issues or your pull-requests before the others. \n\n## Changelog\n\nPlease see the [Changelog](https://github.com/letsar/flutter_sticky_header/blob/master/CHANGELOG.md) page to know what's recently changed.\n\n## Contributions\n\nFeel free to contribute to this project.\n\nIf you find a bug or want a feature, but don't know how to fix/implement it, please fill an [issue](https://github.com/letsar/flutter_sticky_header/issues).  \nIf you fixed a bug or implemented a new feature, please send a [pull request](https://github.com/letsar/flutter_sticky_header/pulls).\n\n## Thanks\n\n:clap: Thanks to [slightfoot](https://github.com/slightfoot) with it's RenderBox version (https://github.com/slightfoot/flutter_sticky_headers) which unintentionally challenged me to work in this RenderSliver version.\n","funding_links":["https://github.com/sponsors/letsar","https://patreon.com/romainrastel","https://www.buymeacoffee.com/romainrastel","paypal.me/RomainRastel","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=QTT34M25RDNL6"],"categories":["Components","组件","Dart","UI [🔝](#readme)","Packages"],"sub_categories":["UI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletsar%2Fflutter_sticky_header","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fletsar%2Fflutter_sticky_header","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletsar%2Fflutter_sticky_header/lists"}