bluefireteam / ordered_set

A simple implementation for an ordered set
MIT License
20 stars 4 forks source link

removeAt(index) #28

Closed masalha-alaa closed 2 months ago

masalha-alaa commented 9 months ago

Great package, but if there's an elementAt method, why isn't there a removeAt method? Currently to imitate that I do mySet.remove(mySet.elementAt(index)).

Is it possible to add a removeAt() method that accepts an index and removes the item at that index?

spydon commented 9 months ago

The elementAt comes from Dart's IterableMixin, hence why we haven't added any removeAt method. https://api.dart.dev/stable/2.7.2/dart-collection/IterableMixin-class.html

It wouldn't hurt to have that method though, so if you want to add it, feel free to put up a PR. :)

masalha-alaa commented 9 months ago

Got it, thanks. I have only about 10 days experience in Flutter & Dart, so I'll leave it to someone else 😄 For now I'll be using mySet.remove(mySet.elementAt(index))