listSetter function
Implementation
listSetter(List list, int idx, dynamic value) {
if (list.length > idx) {
list[idx] = value;
} else if (list.length == idx) {
list.add(value);
} else {
list.addAll(List<num>.filled(idx + 1 - list.length, 0));
list[idx] = value;
}
}