Daniel-Ioannou / flutter_group_list_view

A Flutter ListView in which items can be grouped into sections.
https://pub.dev/packages/group_list_view
MIT License
78 stars 17 forks source link

Support sectionSeparatorBuilder #4

Closed omidraha closed 4 years ago

omidraha commented 4 years ago

Hi, Currently separatorBuilder is used for separating items, It's nice if we have also sectionSeparatorBuilder to separate between sections.

Currently:

H1
Item1
----
Item2
----
H2
Item1
----
Item2
----

I wish:

H1
Item1
----
Item2
====
H2
Item1
----
Item2
===
omidraha commented 4 years ago

Solution without that:

  separatorBuilder: (context, index) {
    if (index.index + 1 == _elements.values.toList()[index.section].length) {
      return Divider();
    } else {
      return Divider(indent: 20, endIndent: 20);
    }
  },
Daniel-Ioannou commented 4 years ago

@omidraha sectionSeparatorBuilder was added at version 1.0.6. For more details please check the documentation HERE.