Currently, when trying to get elements from a small list, you can only get hold of the first element by the list.first getter. It would be useful to have second, third, ... getters too.
I'm not saying that there should be getters up to like threehundredth, but even getters up to tenth or so would be useful.
If implemented, as far as I'm concerned, there aren't any performance or memory disadvantages during runtime of AOT compilation – if you don't use the methods, they'll be tree-shaken away.
Dart will/now have extensions. We now can do that ourselves.
extension <T> on List<T> {
T get second => this[1];
T get third => this[2];
}
Nice! I created a package for that: https://pub.dev/packages/list_accessors
Most helpful comment
Dart will/now have extensions. We now can do that ourselves.