List和map的深复制
deepClone(obj) {
dynamic newObj = obj is Map ? {} : [];
if (obj is Map) {
obj.forEach((key, value) {
if (obj[key] is Map || obj[key] is List) {
newObj[key] = deepClone(value);
} else {
newObj[key] = value;
}
});
}else{
for(int i=0;i<obj.length;i++){
if (obj[i] is Map || obj[i] is List) {
newObj.add(deepClone(obj[i]));
} else {
newObj.add(obj[i]);
}
}
}
return newObj;
}