Dimibe / grouped_list

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

Suggestion: ItemCount for adding extra widget #144

Closed Devlonoah closed 9 months ago

Devlonoah commented 2 years ago

Hi, I'm suggesting that itemCount be added to the parameters available.

As this will allow adding an extra widget : In a scenario where i plan to add a Text or a button [View All] to te end of the item list, Of course the only way to achieve this will be to add 1 to the length of the data being use. a pseudocode to explain what i meant: `var listOfFruit = ["Orange","Apple","Pawpaw"];

ListView.builder( itemcount: listOfFruit.length +1, itemBuilder:(context,index){ if(index ==0){ show Add more Button } else{ show all fruit } }`

Dimibe commented 2 years ago

Hi @Devlonoah, There are similar requests to this one but I think adding the itemcount option to the package will make usage too complicate. Instead I am thinking of an option like footerWidgets / headerWidgets where you can provide a List<Widget> and those items will then be automatically placed on top or below the list. Will this feature meet your needs?

Devlonoah commented 2 years ago

@Dimibe Yes it will.

xxJeevesxx commented 1 year ago

Do you think this will make it into the next update?

ZakwanIbrahim3321 commented 11 months ago

you can achieve it like this

Screenshot 2023-10-13 at 6 23 36 PM
Dimibe commented 9 months ago

Closing this in favor of #152