class Companie { int id; String name; Companie({this.id, this.name}); Companie.fromJson(Map json) { id = json['id']; name = json['name']; } // Map toJson() { // final Map data = new Map(); // data['id'] = this.id; // data['name'] = this.name; // return data; // } @override String toString() { return 'Companie{name: $name}'; } }