import 'package:sport/bean/feedback_type.dart'; class FeedbackCategory { String groupId; String groupName; List types; FeedbackCategory({this.groupId, this.groupName, this.types}); FeedbackCategory.fromJson(Map json) { groupId = json['groupId']; groupName = json['groupName']; if (json['types'] != null) { types = new List(); json['types'].forEach((v) { types.add(new FeedbackType.fromJson(v)); }); } } Map toJson() { final Map data = new Map(); data['groupId'] = this.groupId; data['groupName'] = this.groupName; if (this.types != null) { data['types'] = this.types.map((v) => v.toJson()).toList(); } return data; } }