move method

void move(
  1. int oldIndex,
  2. int newIndex
)

Moves an item from one position to another

This method accepts two int as indices, to move a ItemSerializable from one place to another

Implementation

void move(int oldIndex, int newIndex) {
  if (newIndex > oldIndex) newIndex--;
  final item = _items.removeAt(oldIndex);
  _items.insert(newIndex, item);
}