swaps elements on index1 with index2
index1
index2
void swap(int index1, int index2) { startTransAction(); final temp = this[index1]; this[index1] = this[index2]; this[index2] = temp; endTransAction(); }