rotate static method

List<Object> rotate(
  1. List<Object> list,
  2. int v
)

Implementation

static List<Object> rotate(List<Object> list, int v) {
  if (list.isEmpty) return list;
  var i = v % list.length;
  return list.sublist(i)..addAll(list.sublist(0, i));
}