dart json map to map code example
Example 1: dart map to json string
import 'dart:convert';
...
json.encode(data); // JSON.encode(data) in Dart 1.x
Example 2: dart object to map
class Human {
String name;
int age;
Map<String, dynamic> toMap() {
return {
'name': name,
'age': age,
};
}
}