请问以下内容的新语法是什么?
Map mAcctData = JSON.parse(sResponse); // sResponse is Json String
parse
(和stringify
)已被移至顶级函数。
import 'dart:json' as JSON; // note the JSON name
main() {
var text = // some text...
var map = JSON.parse(text); // using the JSON name
}
或
import 'dart:json'; // note, no JSON name
main() {
var text = // some text...
var map = parse(text); // calling parse as a top-level function.
}