copyWithNewArraySize<T> static method
Implementation
static List<T> copyWithNewArraySize<T>(
List<T> array, int size, T defaultValue) {
final int oldSize = array.length;
return oldSize == size
? array
: <T>[
...array.take(size),
for (int i = oldSize; i < size; i++) defaultValue
];
}