feedback_category.dart 806 B

123456789101112131415161718192021222324252627282930
  1. import 'package:sport/bean/feedback_type.dart';
  2. class FeedbackCategory {
  3. String groupId;
  4. String groupName;
  5. List<FeedbackType> types;
  6. FeedbackCategory({this.groupId, this.groupName, this.types});
  7. FeedbackCategory.fromJson(Map<String, dynamic> json) {
  8. groupId = json['groupId'];
  9. groupName = json['groupName'];
  10. if (json['types'] != null) {
  11. types = new List<FeedbackType>();
  12. json['types'].forEach((v) {
  13. types.add(new FeedbackType.fromJson(v));
  14. });
  15. }
  16. }
  17. Map<String, dynamic> toJson() {
  18. final Map<String, dynamic> data = new Map<String, dynamic>();
  19. data['groupId'] = this.groupId;
  20. data['groupName'] = this.groupName;
  21. if (this.types != null) {
  22. data['types'] = this.types.map((v) => v.toJson()).toList();
  23. }
  24. return data;
  25. }
  26. }