dart, overloading [] operator?

Dart editor seems pretty happy with:

operator [](int i) => list[i]; // get
operator []=(int i, int value) => _list[i] = value; // set

Try it in DartPad


Yes you can override operators. Like this:

T operator [](int index) => items[index];

But you can't overload anything in dart. Because Dart does not support operator or function overloading. That means your class can't have two function with same name but different parameters.