I want to create a more specialized list in dart. I can\'t directly extend List. What are my options?
The answers to this are pretty outdated, and I'm in the process of doing this for my own project, so I thought I'd help some people out by posting a really clean answer that doesn't involve any overriding or implementing of things.
The quiver package has an extendable List class called DelegatingList that makes extending a list trivial.
class FruitList extends DelegatingList {
final List _fruits = [];
List get delegate => _fruits;
// custom methods
}
Hopefully this helps someone who comes across this question like I did!