dart json map list code example
Example 1: dart list to map
var map1 = Map.fromIterable(list, key: (e) => e.name, value: (e) => e.age);
Example 2: dart map to json string
import 'dart:convert';
...
json.encode(data); // JSON.encode(data) in Dart 1.x