JSON.parse to Map howto (new syntax 0.3.1_r17328)
1 answer
parse
(and stringify
) moved to a top-level function.
import 'dart:json' as JSON; // note the JSON name main() { var text = // some text... var map = JSON.parse(text); // using the JSON name }
or
import 'dart:json'; // note, no JSON name main() { var text = // some text... var map = parse(text); // calling parse as a top-level function. }
+6
source to share