All Projects → tp7309 → flutter_sticky_and_expandable_list

tp7309 / flutter_sticky_and_expandable_list

Licence: MIT license
粘性头部与分组列表Sliver实现 Build a grouped list, which support expand/collapse section and sticky headers, support use it with sliver widget.

Programming Languages

dart
5743 projects
HTML
75241 projects

Projects that are alternatives of or similar to flutter sticky and expandable list

Android-sticky-navigation-layout
android sticky navigation layout
Stars: ✭ 17 (-85.34%)
Mutual labels:  sticky, sticky-headers
Floatthead
Fixed <thead>. Doesn't need any custom css/html. Does what position:sticky can't
Stars: ✭ 1,193 (+928.45%)
Mutual labels:  sticky, sticky-headers
Flutter deer
🦌 Flutter 练习项目(包括集成测试、可访问性测试)。内含完整UI设计图,更贴近真实项目的练习。Flutter practice project. Includes a complete UI design and exercises that are closer to real projects.
Stars: ✭ 5,725 (+4835.34%)
Mutual labels:  sliver, sticky-headers
Consecutivescroller
ConsecutiveScrollerLayout是Android下支持多个滑动布局(RecyclerView、WebView、ScrollView等)和普通控件(TextView、ImageView、LinearLayou、自定义View等)持续连贯滑动的容器,它使所有的子View像一个整体一样连续顺畅滑动。并且支持布局吸顶功能。
Stars: ✭ 1,383 (+1092.24%)
Mutual labels:  sticky, sticky-headers
Flutter sticky infinite list
Multi directional infinite list with Sticky headers for Flutter applications
Stars: ✭ 189 (+62.93%)
Mutual labels:  sticky, sticky-headers
Brv
Android上最强大的RecyclerView库
Stars: ✭ 345 (+197.41%)
Mutual labels:  listview, sticky-headers
Ng Sticky
Angular 4 sticky, have header or any component sticky easy to use.
Stars: ✭ 25 (-78.45%)
Mutual labels:  sticky, sticky-headers
Unix Permissions
Swiss Army knife for Unix permissions
Stars: ✭ 106 (-8.62%)
Mutual labels:  sticky, group
React Virtualized Sticky Tree
A React component for efficiently rendering tree like structures with support for position: sticky
Stars: ✭ 115 (-0.86%)
Mutual labels:  sticky, sticky-headers
Stickyheaderlistview
打造炫酷列表之 StickyHeaderListView:标题渐变、吸附悬浮、筛选分类、动态头部等
Stars: ✭ 2,820 (+2331.03%)
Mutual labels:  listview, sticky
Llmlistview
super list view for uwp
Stars: ✭ 27 (-76.72%)
Mutual labels:  listview, group
Dgr
Container build and runtime tool
Stars: ✭ 249 (+114.66%)
Mutual labels:  builder
Cronexpbuilder
Quartz 的Cron任务调度表达式一般人很难理解,在Googole上查询也没有发现类似的代码,所以开发了一个对Quartz Cron 表达式的可视化双向解析和生成的一个java的GUI程序,供使用Quartz的程序员参考和使用.
Stars: ✭ 204 (+75.86%)
Mutual labels:  builder
Zeus
An Electrifying Build System
Stars: ✭ 176 (+51.72%)
Mutual labels:  builder
Urlbuilder
Java Builders: URL builder
Stars: ✭ 174 (+50%)
Mutual labels:  builder
react-expandable-listview
React expandable components, assist you render expandable objects or React components
Stars: ✭ 38 (-67.24%)
Mutual labels:  listview
React Email Editor
Drag-n-Drop Email Editor Component for React.js
Stars: ✭ 3,131 (+2599.14%)
Mutual labels:  builder
Package Builder
📦 A composer package builder.
Stars: ✭ 174 (+50%)
Mutual labels:  builder
Vercel Rust
Community based builder for using rust on the now/zeit platform
Stars: ✭ 168 (+44.83%)
Mutual labels:  builder
Vue Email Editor
Drag-n-Drop Email Editor Component for Vue.js
Stars: ✭ 166 (+43.1%)
Mutual labels:  builder

sticky_and_expandable_list

Flutter implementation of sticky headers and expandable list.Support use it in a CustomScrollView.

Pub README i18n:中文说明

Screenshot

Features

  • Build a grouped list, which support expand/collapse section and sticky header.
  • Use it with CustomScrollView、SliverAppBar.
  • Listen the scroll offset of current sticky header, current sticky header index and switching header index.
  • Only use one list widget, so it supports large data and a normal memory usage.
  • More section customization support, you can return a new section widget by sectionBuilder, to customize background,expand/collapse animation, section layout, and so on.
  • Support add divider.
  • Support overlap content.
  • Support scroll to index like ListView, by scroll-to-index.
  • Pull to refresh and load more, by pull_to_refresh.

Getting Started

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

dependencies:
  sticky_and_expandable_list: ^1.1.2

Basic Usage

sectionList is a custom data source for ExpandableListView. We should create a model list to store the information of each section, the model must implement ExpandableListSection.

    //In this example, we create a custom model class(ExampleSection).
    //class ExampleSection implements ExpandableListSection<String> {}
    //so: SliverExpandableChildDelegate<String, ExampleSection>()
    List<ExampleSection> sectionList = List<ExampleSection>();
    return ExpandableListView(
      builder: SliverExpandableChildDelegate<String, ExampleSection>(
          sectionList: sectionList,
          headerBuilder: (context, sectionIndex, index) =>
              Text("Header #$sectionIndex"),
          itemBuilder: (context, sectionIndex, itemIndex, index) {
            String item = sectionList[sectionIndex].items[itemIndex];
            return ListTile(
              leading: CircleAvatar(
                child: Text("$index"),
              ),
              title: Text(item),
            );
          }),
    );

Detail Examples

If you want to use it with sliver widget, use SliverExpandableList instead of ExpandableListView.

FAQ

How to expand/collapse item?

setState(() {
  sectionList[i].setSectionExpanded(true);
});

Example

How to listen current sticky header or the sticky header scroll offset?

  @override
  Widget build(BuildContext context) {
    ExpandableListView(
      builder: SliverExpandableChildDelegate<String, ExampleSection>(
        headerController: _getHeaderController(),
      ),
    )
  }

  _getHeaderController() {
    var controller = ExpandableListController();
    controller.addListener(() {
      print("switchingSectionIndex:${controller.switchingSectionIndex}, stickySectionIndex:" +
          "${controller.stickySectionIndex},scrollPercent:${controller.percent}");
    });
    return controller;
  }

How to set background for each section?

Use sectionBuilder

Customize expand/collapse animation support?

Example

Change Log

CHANGELOG

Donate

Buy a cup of coffee for me (Scan by wechat):

qrcode

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].