share_info.dart 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import 'package:sport/services/Converter.dart';
  2. class ShareInfo {
  3. int? id;
  4. String? hash;
  5. ShareInfo.fromJson(Map<String, dynamic> json) {
  6. id = Converter.toInt(json['id']);
  7. hash = json['hash'];
  8. }
  9. Map<String, dynamic> toJson() {
  10. final Map<String, dynamic> data = new Map<String, dynamic>();
  11. data['id'] = this.id;
  12. data["share"] = this.hash;
  13. return data;
  14. }
  15. }
  16. class Share {
  17. int? id;
  18. String? hash;
  19. int? consume;
  20. double? defeat;
  21. int? duration;
  22. String? period;
  23. double? weight;
  24. Share(
  25. {this.id,
  26. this.hash,
  27. this.consume,
  28. this.defeat,
  29. this.duration,
  30. this.period,
  31. this.weight});
  32. Share.fromJson(Map<String, dynamic> json) {
  33. id = Converter.toInt(json['id']);
  34. hash = json["hash"];
  35. consume = json['consume'];
  36. defeat = json['defeat'];
  37. duration = json['duration'];
  38. period = json['period'];
  39. weight = json['weight'];
  40. }
  41. Map<String, dynamic> toJson() {
  42. final Map<String, dynamic> data = new Map<String, dynamic>();
  43. data['id'] = this.id;
  44. data["hash"] = this.hash;
  45. data["consume"] = this.consume;
  46. data['defeat'] = this.defeat;
  47. data['duration'] = this.duration;
  48. data['period'] = this.period;
  49. data['weight'] = this.weight;
  50. return data;
  51. }
  52. }