setMatrixChoice function
Implementation
Map<String,List<String>> setMatrixChoice(Map<String,List<String>> answer,String row,String column,{required bool multiple}){final next={for(final entry in answer.entries)entry.key:[...entry.value]};if(!multiple){next[row]=[column];return next;}final selected=next[row]??[];selected.contains(column)?selected.remove(column):selected.add(column);if(selected.isEmpty){next.remove(row);}else{next[row]=selected;}return next;}