moveElementBackward<T> function
Implementation
int moveElementBackward<T>(List<T> list, T element) {
int i = list.indexOf(element);
if (i != -1 && i < list.length - 1) {
final tmp = list[i + 1];
list[i + 1] = list[i];
list[i] = tmp;
return i + 1;
}
return i;
}