my obj is:
Map myJSON = {
"name": {"first":"foo","last":"bar"},
"age":31, "city":"New York"
};
Run Code Online (Sandbox Code Playgroud)
I want to replace it with the new output Ex:
String myJSON = '{"name":{"first":"foo","last":"bar"}, "age":31, "city":"New York"}';
Run Code Online (Sandbox Code Playgroud)
use*_*745 22
使用convert
类
import 'dart:convert';
Run Code Online (Sandbox Code Playgroud)
将字符串转换为映射
json.decode(stringData);
Run Code Online (Sandbox Code Playgroud)
将地图转换为字符串
json.encode(mapData);
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
8058 次 |
最近记录: |