sport_target_record.dart 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import 'package:sport/bean/sport_target.dart';
  2. class SportTargetRecord {
  3. int id;
  4. int userId;
  5. int consume;
  6. int duration;
  7. int consumeTarget;
  8. int durationTarget;
  9. bool finish;
  10. String type;
  11. String createdAt;
  12. int durationMinute;
  13. int durationTargetMinute;
  14. SportTargetRecord(
  15. {this.id,
  16. this.userId,
  17. this.consume,
  18. this.duration,
  19. this.consumeTarget,
  20. this.durationTarget,
  21. this.finish,
  22. this.type,
  23. this.createdAt,
  24. this.durationMinute,
  25. this.durationTargetMinute});
  26. SportTargetRecord.fromJson(Map<String, dynamic> json) {
  27. id = json['id'];
  28. userId = json['user_id'];
  29. consume = json['consume'];
  30. duration = json['duration'];
  31. consumeTarget = json['consume_target'];
  32. durationTarget = json['duration_target'];
  33. finish = json['finish'];
  34. type = json['type'];
  35. createdAt = json['created_at'];
  36. durationMinute = json['duration_minute'];
  37. durationTargetMinute = json['duration_target_minute'];
  38. }
  39. Map<String, dynamic> toJson() {
  40. final Map<String, dynamic> data = new Map<String, dynamic>();
  41. data['id'] = this.id;
  42. data['user_id'] = this.userId;
  43. data['consume'] = this.consume;
  44. data['duration'] = this.duration;
  45. data['consume_target'] = this.consumeTarget;
  46. data['duration_target'] = this.durationTarget;
  47. data['finish'] = this.finish;
  48. data['type'] = this.type;
  49. data['created_at'] = this.createdAt;
  50. data['duration_minute'] = this.durationMinute;
  51. data['duration_target_minute'] = this.durationTargetMinute;
  52. return data;
  53. }
  54. }