Dimibe / sticky_grouped_list

A ScrollablePositionedList in which items can be grouped into sections with sticky headers.
https://pub.dev/packages/sticky_grouped_list
MIT License
184 stars 71 forks source link

How to disable floating Header #38

Open insinfo opened 2 years ago

insinfo commented 2 years ago

I put floatingHeader: false but it still keeps displaying floating header

StickyGroupedListView<Agenda, DateTime>(
                elements: _elements,
                order: StickyGroupedListOrder.DESC, // optional
                //stickyHeaderBackgroundColor: Colors.transparent,
                groupBy: (Agenda element) {
                  return DateTime(
                      element.data.year, element.data.month, element.data.day);
                },
                groupComparator: (DateTime value1, DateTime value2) =>
                    value2.compareTo(value1),
                itemComparator: (Agenda element1, Agenda element2) =>
                    element1.data.compareTo(element2.data),
                floatingHeader: false,
                groupSeparatorBuilder: (Agenda element) => Container(
                  height: 50,
                  child: Align(
                    alignment: Alignment.center,
                    child: Container(
                      width: 120,
                      decoration: BoxDecoration(
                        color: Colors.blue[300],
                        border: Border.all(
                          color: Colors.blue[300],
                        ),
                        borderRadius: BorderRadius.all(Radius.circular(20.0)),
                      ),
                      child: Padding(
                        padding: EdgeInsets.all(8.0),
                        child: Text(
                          '${element.week}',
                          style: TextStyle(color: Colors.white),
                          textAlign: TextAlign.center,
                        ),
                      ),
                    ),
                  ),
                ),

                itemBuilder: (context, Agenda element) => listItem(element),
              ),

image

ilkinaslanli2001 commented 2 years ago

Did you solve it?

rezashamdani commented 2 years ago

waiting for this issue too

rezashamdani commented 2 years ago

for quick fixes: remark the function at line 329 to 338

waqadArshad commented 2 years ago

@rezashamdani what do you mean by "remark"?

SilenceCodder commented 1 year ago

The author should please fix this floating header issue.

This package is Good but only issue is not been able to TURN OFF floating header.

If it's not yet fixed, Any new comer should use this alternative package

grouped_list: ^5.1.2

th8m0z commented 9 months ago

I have created a fork where I added an additional parameter to disable the floating header. Currently this also removes the first normal header, but if you want I can also fix this.