diffutil_sliverlist icon indicating copy to clipboard operation
diffutil_sliverlist copied to clipboard

Index in builder function

Open Mosc opened this issue 2 years ago • 3 comments

I'd like to have access to an item's index in the builder function, in addition to the existing BuildContext and item T. If needed, I could offer this change myself in a PR. Let me know!

Mosc avatar Mar 21 '22 20:03 Mosc

Hi!

having an index in the builder is a valid use case. However, I intended this package to mostly be a minimal viable example of what diffutil_dart could be used for. Looking at the popularity on pub.dev, it seems a few people do use it, and adding the index would be a breaking change. I'm hesitant to go for that.

You're welcome to fork (it's just <200 lines of code anyway) or use any of the packages using diffutil_dart with more batteries included - like https://pub.dev/packages/great_list_view

knaeckeKami avatar Mar 21 '22 20:03 knaeckeKami

Thanks for the quick response.

It would be a breaking change, but that's what semantic versioning is for, right? :) Of course, I fully understand if you don't want to commit to that, in which case a fork seems like a reasonable option.

I've had a look at great_list_view before, but it seemed incredibly daunting for the sliver use case, which would not be able to make use of the batteries included AutomaticAnimatedListView. Perhaps I should give it another shot.

Mosc avatar Mar 21 '22 21:03 Mosc

But when is removed item, this position is not will correspond list item by the position.

list[position] != item

kmartins avatar Mar 30 '22 18:03 kmartins