deepCopyStyle method
dynamic
deepCopyStyle(
- dynamic value
Implementation
deepCopyStyle(value){
try {
//对linedata颜色进行序列化
var obj = value;
for (var entry in obj.entries) {
if(entry.value is Map){
if(entry.value['color'] is Color){
var list = Tools.getRGBOFromColor(entry.value['color']);
entry.value['color'] = list;
}
if(entry.value['fillc'] is Color){
entry.value['fillc'] = Tools.getRGBOFromColor(entry.value['fillc']);
}
}
}
//复制
var data = Tools.deepCopy(obj);
//颜色反序列化
for (var entry in obj.entries) {
if(entry.value is Map){
if(entry.value['color'] is List){
entry.value['color'] = Tools.getColorFromList(entry.value['color']);
}
if(entry.value['fillc'] is List){
entry.value['fillc'] = Tools.getColorFromList(entry.value['fillc']);
}
}
}
for (var entry in data.entries) {
if(entry.value is Map){
if(entry.value['color'] is List){
entry.value['color'] = Tools.getColorFromList(entry.value['color']);
}
if(entry.value['fillc'] is List){
entry.value['fillc'] = Tools.getColorFromList(entry.value['fillc']);
}
}
}
return data;
} catch (error) {
// print(error);
}
}