{"id":13790197,"url":"https://github.com/tp7309/flutter_sticky_and_expandable_list","last_synced_at":"2026-02-23T19:08:48.868Z","repository":{"id":45706113,"uuid":"245911819","full_name":"tp7309/flutter_sticky_and_expandable_list","owner":"tp7309","description":"粘性头部与分组列表Sliver实现 Build a grouped list, which support expand/collapse section and sticky headers, support use it with sliver widget.","archived":false,"fork":false,"pushed_at":"2023-09-24T11:29:04.000Z","size":11247,"stargazers_count":140,"open_issues_count":1,"forks_count":27,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-18T04:35:47.107Z","etag":null,"topics":["builder","collapse-animation-support","expandablelistview","group","listview","pin","sliver","sticky","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/tp7309.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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.paypal.com/paypalme/tp7309","https://user-images.githubusercontent.com/5046191/118354036-b075ca80-b59b-11eb-862e-ffd1b8e1659f.png"]}},"created_at":"2020-03-09T00:37:16.000Z","updated_at":"2024-11-16T02:16:50.000Z","dependencies_parsed_at":"2024-04-02T11:05:03.585Z","dependency_job_id":null,"html_url":"https://github.com/tp7309/flutter_sticky_and_expandable_list","commit_stats":{"total_commits":67,"total_committers":2,"mean_commits":33.5,"dds":"0.014925373134328401","last_synced_commit":"f1712fc0ee187cdcd86def20d72fa20416539f4c"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tp7309%2Fflutter_sticky_and_expandable_list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tp7309%2Fflutter_sticky_and_expandable_list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tp7309%2Fflutter_sticky_and_expandable_list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tp7309%2Fflutter_sticky_and_expandable_list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tp7309","download_url":"https://codeload.github.com/tp7309/flutter_sticky_and_expandable_list/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253695155,"owners_count":21948822,"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":["builder","collapse-animation-support","expandablelistview","group","listview","pin","sliver","sticky","sticky-headers"],"created_at":"2024-08-03T22:00:38.687Z","updated_at":"2025-10-23T06:22:37.000Z","avatar_url":"https://github.com/tp7309.png","language":"Dart","funding_links":["https://www.paypal.com/paypalme/tp7309","https://user-images.githubusercontent.com/5046191/118354036-b075ca80-b59b-11eb-862e-ffd1b8e1659f.png"],"categories":["Packages"],"sub_categories":[],"readme":"# sticky_and_expandable_list\nFlutter implementation of sticky headers and expandable list.Support use it in a CustomScrollView.\n\n[![Pub](https://img.shields.io/pub/v/sticky_and_expandable_list.svg)](https://pub.dartlang.org/packages/sticky_and_expandable_list)\nREADME i18n:[中文说明](https://github.com/tp7309/flutter_sticky_and_expandable_list/blob/master/README_zh_CN.md)\n\n![Screenshot](https://raw.githubusercontent.com/tp7309/flutter_sticky_and_expandable_list/master/doc/images/sliverlist.gif)\n\n## Features\n\n- Build a grouped list, which support expand/collapse section and sticky header.\n- Use it with CustomScrollView、SliverAppBar.\n- Listen the scroll offset of current sticky header, current sticky header index and switching header index.\n- Only use one list widget, so it supports large data and a normal memory usage.\n- More section customization support, you can return a new section widget by sectionBuilder, to customize background，expand/collapse animation, section layout, and so on.\n- Support add divider.\n- Support overlap content.\n- Support scroll to index like ListView, by [scroll-to-index](https://github.com/quire-io/scroll-to-index).\n- Pull to refresh and load more, by [pull_to_refresh](https://github.com/peng8350/flutter_pulltorefresh).\n\n## Getting Started\n\nIn the `pubspec.yaml` of your flutter project, add the following dependency:\n\n```yaml\ndependencies:\n  sticky_and_expandable_list: ^1.1.3\n```\n\n## Basic Usage\n`sectionList` is a custom data source for `ExpandableListView`.\nWe should create a model list to store the information of each section, the model must implement `ExpandableListSection`.\n```dart\n    //In this example, we create a custom model class(ExampleSection).\n    //class ExampleSection implements ExpandableListSection\u003cString\u003e {}\n    //so: SliverExpandableChildDelegate\u003cString, ExampleSection\u003e()\n    List\u003cExampleSection\u003e sectionList = List\u003cExampleSection\u003e();\n    return ExpandableListView(\n      builder: SliverExpandableChildDelegate\u003cString, ExampleSection\u003e(\n          sectionList: sectionList,\n          headerBuilder: (context, sectionIndex, index) =\u003e\n              Text(\"Header #$sectionIndex\"),\n          itemBuilder: (context, sectionIndex, itemIndex, index) {\n            String item = sectionList[sectionIndex].items[itemIndex];\n            return ListTile(\n              leading: CircleAvatar(\n                child: Text(\"$index\"),\n              ),\n              title: Text(item),\n            );\n          }),\n    );\n```\n\n[Detail Examples](https://github.com/tp7309/flutter_sticky_and_expandable_list/tree/master/example/lib)\n\nIf you want to use it with sliver widget, use **SliverExpandableList** instead of ExpandableListView.\n\n## FAQ\n\n### How to expand/collapse item?\n\n```dart\nsetState(() {\n  sectionList[i].setSectionExpanded(true);\n});\n```\n\n[Example](https://github.com/tp7309/flutter_sticky_and_expandable_list/blob/master/example/lib/example_listview.dart)\n\n### How to listen current sticky header or the sticky header scroll offset?\n\n```dart\n  @override\n  Widget build(BuildContext context) {\n    ExpandableListView(\n      builder: SliverExpandableChildDelegate\u003cString, ExampleSection\u003e(\n        headerController: _getHeaderController(),\n      ),\n    )\n  }\n\n  _getHeaderController() {\n    var controller = ExpandableListController();\n    controller.addListener(() {\n      print(\"switchingSectionIndex:${controller.switchingSectionIndex}, stickySectionIndex:\" +\n          \"${controller.stickySectionIndex},scrollPercent:${controller.percent}\");\n    });\n    return controller;\n  }\n```\n\n### How to set background for each section?\n\nUse [sectionBuilder](https://github.com/tp7309/flutter_sticky_and_expandable_list/blob/master/example/lib/example_custom_section_animation.dart)\n\n### Customize expand/collapse animation support?\n\n[Example](https://github.com/tp7309/flutter_sticky_and_expandable_list/blob/master/example/lib/example_custom_section_animation.dart)\n\n## Change Log\n\n[CHANGELOG](https://github.com/tp7309/flutter_sticky_and_expandable_list/blob/master/CHANGELOG.md)\n\n## Donate\n\nBuy a cup of coffee for me (Scan by wechat)：\n\n![qrcode](https://user-images.githubusercontent.com/5046191/118354036-b075ca80-b59b-11eb-862e-ffd1b8e1659f.png)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftp7309%2Fflutter_sticky_and_expandable_list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftp7309%2Fflutter_sticky_and_expandable_list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftp7309%2Fflutter_sticky_and_expandable_list/lists"}