moveElementRight static method

void moveElementRight(
  1. List input,
  2. dynamic element
)

Implementation

static void moveElementRight(List input, dynamic element) {
  final currentIndex = input.indexOf(element);
  if (currentIndex + 1 < input.length) {
    input.removeAt(currentIndex);
    input.insert(currentIndex + 1, element);
  }
}