tp7309 / flutter_sticky_and_expandable_list

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Customize section class

tp7309 opened this issue · comments

You can define an section class as you like, the only requirement is implement ExpandableListSection, this is to provide item data list in section. Like this:

class Section implements ExpandableListSection<Widget> {
  bool expanded;
  Widget header;
  List<Widget> items;

  @override
  List<Widget> getItems() {
    return items;
  }

  @override
  bool isSectionExpanded() {
    return expanded;
  }

  @override
  void setSectionExpanded(bool expanded) {
    this.expanded = expanded;
  }
}
``

With this implementation of Section class I get the following error:
Screenshot_20200316_234941

class Section implements ExpandableListSection<Widget> {}
//so:
SliverExpandableChildDelegate<Widget, Section>()