flutter JSON 序列化与反序列化
// string 转对象
var str = '{"name":"zhangsan","age":11}';
var obj = jsonDecode(str);
// 对象转 string
var obj = {
"name": "zhangsan",
"age": 11
};
var str = jsonEncode(obj);
// string 转对象
var str = '{"name":"zhangsan","age":11}';
var obj = jsonDecode(str);
// 对象转 string
var obj = {
"name": "zhangsan",
"age": 11
};
var str = jsonEncode(obj);