mergeId static method Null safety

List<int> mergeId(
  1. List<int> list,
  2. int id
)

Implementation

static List<int> mergeId(List<int> list, int id){
  if(!list.contains(id)) list.add(id);
  return list;
}