moveElementLeft static method

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

Implementation

static void moveElementLeft(List input, dynamic element) {
  final currentIndex = input.indexOf(element);
  if (currentIndex - 1 >= 0) {
    input.removeAt(currentIndex);
    input.insert(currentIndex - 1, element);
  }
}