I am having an Iterable<MyClass> where MyClass has an attribute data. Now I want to remove elements from my Iterable starting from the last added item. I want to remove them until the sum of all characters in all data attributes that are still in the Iterable are below some threshold.
Of course I could just iterate over the list, remove the last, then check, remove next etc. With a simple loop and if-statement. I just wonder if there is a more elegant way to do this in dart? Using some builtin function?
Thanks!
It's important to know what approach you're using now
But if I had a similar problem I would do it this way:
class MyClass { String data;