move method

void move(
  1. int from,
  2. int to
)

Move the element at index from to index to.

Implementation

void move(int from, int to) {
  RangeError.checkValidIndex(from, this, 'from', length);
  RangeError.checkValidIndex(to, this, 'to', length);
  if (to == from) return; // no-op
  final self = this;
  if (self is ManagedRealmList<T>) {
    self.move(from, to);
  } else {
    insert(to, removeAt(from));
  }
}