chopList<T> function

List<T> chopList<T>(
  1. Iterable<T> items
)

Implementation

List<T> chopList<T>(Iterable<T> items) {
  final list = [...items];
  if (list.isEmpty) return list;

  return list.sublist(0, list.length - 1);
}