chunk method

List<String> chunk(
  1. int size
)

Implementation

List<String> chunk(int size) {
  List<String> chunks = [];
  for (var i = 0; i < length; i += size) {
    chunks.add(substring(i, min(i + size, length)));
  }
  return chunks;
}