我有一个关于json序列化飞镖的小问题。我正在使用“可导出”的lib。 https://pub.dartlang.org/packages/exportable
这里有一个小代码:
Condition t = new Condition();
Configurator configurator1 = new Exportable(Configurator);
configurator1.alias = conf_b_1;
configurator1.value = conf1;
Configurator configurator2 = new Exportable(Configurator);
configurator2.alias = conf_b_2;
configurator2.value = conf2;
t.configurators.add(configurator1);
ntp.condition = t;
print("________________toString_______________");
print(""+t.toString());
print("_______________________________________");
print("________________toJson_______________");
print(""+t.toJson());
print("_______________________________________");
结果是:
________________ toString_______________ { “REF”: “4”, “logicalRefId”: “41”, “值”: “1”, “别名”:假, “配置器”:[ “{\” 别名\ “:\” 1 \”, \ “值\”:\ “10 \”}“]}
________________ toJson_______________ { “REF”: “4”, “logicalRefId”: “41”, “值”: “1”, “别名”:假, “配置器”:[ “{\” 别名\ “:\” 1 \”, \ “值\”:\ “10 \”}“]}
配置器部分完全坏了。我在哪里做错了?
提前阅读我, Nerio。